On Wed, Feb 1, 2017 at 2:32 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Also, including the GID in the WAL for each COMMIT/ABORT PREPARED
>> doesn't seem inordinately expensive to me.
>
> I'm confused ... isn't it there already? If not, how do we handle
> reconstructing 2PC state from WAL at all?
By XID. See xl_xact_twophase, which gets included in xl_xact_commit
or xl_xact_abort. The GID has got to be there in the XL_XACT_PREPARE
record, but not when actually committing/rolling back.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company