]> granicus.if.org Git - postgresql/commitdiff
Cleanup VirtualXact at end of Hot Standby
authorSimon Riggs <simon@2ndQuadrant.com>
Thu, 29 Nov 2012 22:17:15 +0000 (22:17 +0000)
committerSimon Riggs <simon@2ndQuadrant.com>
Thu, 29 Nov 2012 22:17:15 +0000 (22:17 +0000)
Resolves bug 7572 reported by Daniele Varrazzo

src/backend/storage/ipc/standby.c
src/backend/storage/lmgr/lock.c
src/include/storage/lock.h

index 8205b4135e47ca656eb531572e64cbeeaea2e0e2..0658feb076cafcd262b029a6b0cbef76d8189fac 100644 (file)
@@ -103,6 +103,9 @@ ShutdownRecoveryTransactionEnvironment(void)
 
        /* Release all locks the tracked transactions were holding */
        StandbyReleaseAllLocks();
+
+       /* Cleanup our VirtualTransaction */
+       VirtualXactLockTableCleanup();
 }
 
 
index cfe3954637d723822b95ec4e64e457e193bb0854..c76699dfeb8d0f0257047d3af1b57984b1934f85 100644 (file)
@@ -209,7 +209,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
@@ -3734,7 +3733,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 d629ac2ad2e7cfb11988284d7df78644de46ab3a..2d487fffe3acc16f6873f12d12e06090381b5fd8 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 */