On 02/01/2017 10:32 PM, Tom Lane 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?
>
> regards, tom lane
>
>
Right now logical decoding ignores prepare and take in account only "commit prepared":
/* * Currently decoding ignores PREPARE TRANSACTION and will just * decode the
transactionwhen the COMMIT PREPARED is sent or * throw away the transaction's contents when a ROLLBACK
PREPARED * is received. In the future we could add code to expose prepared * transactions in the
changestreamallowing for a kind of * distributed 2PC. */
For some scenarios it works well, but if we really need prepared state at replica (as in case of multimaster), then it
isnot enough.
--
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company