From ee450eed07dffe12279d9fe718ae1a61381c1c42 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Thu, 11 Apr 2019 20:43:06 +1200 Subject: [PATCH] Fix GetNewTransactionId() on collision with xidVacLimit. Commit ad308058 switched to returning a FullTransactionId, but failed to load the potentially updated value in the case where xidVacLimit has been reached and we release and reacquire the lock. Bug #15727. Reported-by: Roman Zharkov Discussion: https://postgr.es/m/15727-0be246e7d852d229%40postgresql.org --- src/backend/access/transam/varsup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c index 8c3d84fbf2..0b04c5d9f9 100644 --- a/src/backend/access/transam/varsup.c +++ b/src/backend/access/transam/varsup.c @@ -159,6 +159,7 @@ GetNewTransactionId(bool isSubXact) /* Re-acquire lock and start over */ LWLockAcquire(XidGenLock, LW_EXCLUSIVE); + full_xid = ShmemVariableCache->nextFullXid; xid = XidFromFullTransactionId(ShmemVariableCache->nextFullXid); } -- 2.21.0