On 2014-04-14 12:15:30 +0300, Heikki Linnakangas wrote:
> Hmm. There's a field in GlobalTransactionData called locking_xid, which is
> used to mark the XID of the transaction that's currently operating on the
> prepared transaction. At prepare, that ensures that the transaction cannot
> be committed or rolled back by another backend until the original backend
> has cleared its PGPROC entry. At COMMIT/ROLLBACK PREPARED, it ensures that
> only one backend can commit/rollback the transaction.
>
> I wonder why we don't use a VirtualTransactionId there.
I wondered about that previously as well. My bet it's because the 2pc
support arrived before the virtualxact stuff...
Greetings,
Andres Freund
-- Andres Freund http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services