Simon Riggs wrote:
> The patch isn't ready to apply standalone because we need to include the
> changes to XidInMVCCSnapshot() also, which would take a little while to
> extract. Let me know if that is worth producing a standalone patch for.
FWIW, this patch becomes a lot simpler if you don't change the function
signature, and don't move the SubtransSetParent() call.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
*** src/backend/access/transam/xact.c
--- src/backend/access/transam/xact.c
***************
*** 404,419 **** AssignTransactionId(TransactionState s)
AssignTransactionId(s->parent);
/*
! * Generate a new Xid and record it in PG_PROC and pg_subtrans.
! *
! * NB: we must make the subtrans entry BEFORE the Xid appears anywhere in
! * shared storage other than PG_PROC; because if there's no room for it in
! * PG_PROC, the subtrans entry is needed to ensure that other backends see
! * the Xid as "running". See GetNewTransactionId.
*/
s->transactionId = GetNewTransactionId(isSubXact);
! if (isSubXact)
SubTransSetParent(s->transactionId, s->parent->transactionId);
/*
--- 404,418 ----
AssignTransactionId(s->parent);
/*
! * Generate a new Xid and record it in PG_PROC. If there's no room
! * in MyProc-> in MyProc->subxids, we must make the pg_subtrans
! * entry BEFORE the Xid appears anywhere in shared storage other than
! * PG_PROC, because the subtrans entry is needed to ensure that other
! * backends see the Xid as "running".
*/
s->transactionId = GetNewTransactionId(isSubXact);
! if (isSubXact && MyProc->subxids.overflowed)
SubTransSetParent(s->transactionId, s->parent->transactionId);
/*