]> granicus.if.org Git - postgresql/commitdiff
Cleanup VirtualXact at end of Hot Standby.
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 29 Nov 2012 21:59:11 +0000 (21:59 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 29 Nov 2012 21:59:11 +0000 (21:59 +0000)
src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/lock.c
src/include/storage/lock.h

index 9d2003867b5d552a8e8861de4d534eab43451236..7fd94f3e50a26c9380c14a4964852c12e2089335 100644 (file)
@@ -105,6 +105,9 @@ ShutdownRecoveryTransactionEnvironment(void)
 
        /* Release all locks the tracked transactions were holding */
        StandbyReleaseAllLocks();
+
+       /* Cleanup our VirtualTransaction */
+       VirtualXactLockTableCleanup();
 }
 
 
index 32cc229c8640a50ce4621659b1a01c4e681b5d4e..01834437467d6428e17f81af74fdbc0dbab96f93 100644 (file)
@@ -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;
index d56f0fa4b74f82682529e4f2586cf4a079002def..e01a5c504434bc83591519b0f6b171536575de41 100644 (file)
@@ -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 */