Re: pgsql: Store 2PC GID in commit/abort WAL recs for logical decoding

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: Michael Paquier <michael@paquier.xyz>
Cc: Simon Riggs <simon@2ndQuadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-17T20:15:08Z
Lists: pgsql-hackers
On 10/04/18 03:24, Michael Paquier wrote:
> +   /* 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?

Hmm. 'twophase_gid' is actually 4-byte aligned here. But it's a string, 
so it doesn't matter whether it it is or not.

> And that all the last fields of xl_xact_commit and xl_xact_abort are
> kept as such on purpose?

I think that's clear without an explicit comment. If it wasn't on 
purpose, we wouldn't have a comment pointing it out (or we would fix it 
so that it was aligned).

Pushed, thanks for the review!

- Heikki


Commits

  1. Fix off-by-one bug in XactLogCommitRecord

  2. Fix confusion on the padding of GIDs in on commit and abort records.

  3. Store 2PC GID in commit/abort WAL recs for logical decoding