diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c index 9d2003867b5d552a8e8861de4d534eab43451236..7fd94f3e50a26c9380c14a4964852c12e2089335 100644 --- a/src/backend/storage/ipc/standby.c +++ b/src/backend/storage/ipc/standby.c @@ -105,6 +105,9 @@ ShutdownRecoveryTransactionEnvironment(void) /* Release all locks the tracked transactions were holding */ StandbyReleaseAllLocks(); + + /* Cleanup our VirtualTransaction */ + VirtualXactLockTableCleanup(); } diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c index 32cc229c8640a50ce4621659b1a01c4e681b5d4e..01834437467d6428e17f81af74fdbc0dbab96f93 100644 --- a/src/backend/storage/lmgr/lock.c +++ b/src/backend/storage/lmgr/lock.c @@ -210,7 +210,6 @@ static bool FastPathUnGrantRelationLock(Oid relid, LOCKMODE lockmode); static bool FastPathTransferRelationLocks(LockMethod lockMethodTable, const LOCKTAG *locktag, uint32 hashcode); static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock); -static void VirtualXactLockTableCleanup(void); /* * To make the fast-path lock mechanism work, we must have some way of @@ -3791,7 +3790,7 @@ VirtualXactLockTableInsert(VirtualTransactionId vxid) * Check whether a VXID lock has been materialized; if so, release it, * unblocking waiters. */ -static void +void VirtualXactLockTableCleanup() { bool fastpath; diff --git a/src/include/storage/lock.h b/src/include/storage/lock.h index d56f0fa4b74f82682529e4f2586cf4a079002def..e01a5c504434bc83591519b0f6b171536575de41 100644 --- a/src/include/storage/lock.h +++ b/src/include/storage/lock.h @@ -544,6 +544,7 @@ extern void DumpAllLocks(void); /* Lock a VXID (used to wait for a transaction to finish) */ extern void VirtualXactLockTableInsert(VirtualTransactionId vxid); +extern void VirtualXactLockTableCleanup(void); extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait); #endif /* LOCK_H */