Commit f1e57a4e authored by Simon Riggs's avatar Simon Riggs

Cleanup VirtualXact at end of Hot Standby.

parent 7a2fe9bd
...@@ -105,6 +105,9 @@ ShutdownRecoveryTransactionEnvironment(void) ...@@ -105,6 +105,9 @@ ShutdownRecoveryTransactionEnvironment(void)
/* Release all locks the tracked transactions were holding */ /* Release all locks the tracked transactions were holding */
StandbyReleaseAllLocks(); StandbyReleaseAllLocks();
/* Cleanup our VirtualTransaction */
VirtualXactLockTableCleanup();
} }
......
...@@ -210,7 +210,6 @@ static bool FastPathUnGrantRelationLock(Oid relid, LOCKMODE lockmode); ...@@ -210,7 +210,6 @@ static bool FastPathUnGrantRelationLock(Oid relid, LOCKMODE lockmode);
static bool FastPathTransferRelationLocks(LockMethod lockMethodTable, static bool FastPathTransferRelationLocks(LockMethod lockMethodTable,
const LOCKTAG *locktag, uint32 hashcode); const LOCKTAG *locktag, uint32 hashcode);
static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock); static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock);
static void VirtualXactLockTableCleanup(void);
/* /*
* To make the fast-path lock mechanism work, we must have some way of * To make the fast-path lock mechanism work, we must have some way of
...@@ -3791,7 +3790,7 @@ VirtualXactLockTableInsert(VirtualTransactionId vxid) ...@@ -3791,7 +3790,7 @@ VirtualXactLockTableInsert(VirtualTransactionId vxid)
* Check whether a VXID lock has been materialized; if so, release it, * Check whether a VXID lock has been materialized; if so, release it,
* unblocking waiters. * unblocking waiters.
*/ */
static void void
VirtualXactLockTableCleanup() VirtualXactLockTableCleanup()
{ {
bool fastpath; bool fastpath;
......
...@@ -544,6 +544,7 @@ extern void DumpAllLocks(void); ...@@ -544,6 +544,7 @@ extern void DumpAllLocks(void);
/* Lock a VXID (used to wait for a transaction to finish) */ /* Lock a VXID (used to wait for a transaction to finish) */
extern void VirtualXactLockTableInsert(VirtualTransactionId vxid); extern void VirtualXactLockTableInsert(VirtualTransactionId vxid);
extern void VirtualXactLockTableCleanup(void);
extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait); extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait);
#endif /* LOCK_H */ #endif /* LOCK_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment