From: Michael Paquier <michael@paquier.xyz>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding
Date: Tue, 10 Apr 2018 16:24:35 +0900
Message-ID: <20180410072435.GE26769@paquier.xyz> (raw)
In-Reply-To: <33b787bf-dc20-1161-54e9-3f3b607bf59d@iki.fi>
References: <E1f1EEd-000851-3T@gemulon.postgresql.org>
<33b787bf-dc20-1161-54e9-3f3b607bf59d@iki.fi>
On Mon, Apr 09, 2018 at 03:30:39PM +0300, Heikki Linnakangas wrote:
> There seems to be some confusion on the padding here. Firstly, what's the
> point of zero-padding the GID length to the next MAXALIGN boundary, which
> would be 8 bytes on 64-bit systems, if the start is only guaranteed 4-byte
> alignment, per the comment at the memcpy() above. Secondly, if we're
> memcpying the fields that follow anyway, why bother with any alignment
> padding at all?
It seems to me that you are right here: those complications are not
necessary.
if (replorigin)
+ {
/* Move LSNs forward for this replication origin */
replorigin_session_advance(replorigin_session_origin_lsn,
gxact->prepare_end_lsn);
+ }
This is better style.
+ /* twophase_gid follows if XINFO_HAS_GID. As a null-terminated string. */
+ /* xl_xact_origin follows if XINFO_HAS_ORIGIN, stored unaligned! */
Worth mentioning that the first one is also unaligned with your patch?
And that all the last fields of xl_xact_commit and xl_xact_abort are
kept as such on purpose?
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
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, hlinnaka@iki.fi, simon@2ndQuadrant.com, pgsql-hackers@postgresql.org
Subject: Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding
In-Reply-To: <20180410072435.GE26769@paquier.xyz>
References: <E1f1EEd-000851-3T@gemulon.postgresql.org> <33b787bf-dc20-1161-54e9-3f3b607bf59d@iki.fi> <20180410072435.GE26769@paquier.xyz>
* 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