pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make origin data initialization consistent other fields in 2PC h
Date: Mon, 14 Feb 2022 00:31:35 +0000
Message-ID: <E1nJPHD-00013n-U3@gemulon.postgresql.org> (raw)

Make origin data initialization consistent other fields in 2PC header

As of 1eb6d65, the origin data is optionally stored in a 2PC file
header, with the data filled in EndPrepare() even in the default case
where there is no origin data to add.  This was inconsistent with all
the other fields of TwoPhaseFileHeader which are initialized in
StartPrepare(), so move the initialization of origin_lsn and
origin_timestamp there instead.  The effect of missing the
initialization at this early stage is only cosmetic based on the current
logic of the code, but could have led to issues in the long-term, and it
is more consistent done this way.

Reported-by: Ranier Vilela
Discussion: https://postgr.es/m/CAEudQAooECJ+gU_RZB-yhioPOV94R4ucoHAf68PiJhLpgpVpBw@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c963e84fb8c8ec75bfdbe6a7a0857ccd1378baa0

Modified Files
--------------
src/backend/access/transam/twophase.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)



Message-ID: <E1nJPHD-00013n-U3@gemulon.postgresql.org>
Permalink:  ../E1nJPHD-00013n-U3@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nJPHD-00013n-U3@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Make origin data initialization consistent other fields in 2PC h
  In-Reply-To: <E1nJPHD-00013n-U3@gemulon.postgresql.org>
  References: <E1nJPHD-00013n-U3@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox