aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2012-11-29 21:59:11 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2012-11-29 21:59:11 +0000
commitf1e57a4ec9c0ce875683d556909a28a5549da455 (patch)
tree473d3c1dbf9b0ad488fb8c80c3955df240960d04 /src
parent7a2fe9bd0371b819aacc97a007ec1d955237d207 (diff)
downloadpostgresql-f1e57a4ec9c0ce875683d556909a28a5549da455.tar.gz
postgresql-f1e57a4ec9c0ce875683d556909a28a5549da455.zip
Cleanup VirtualXact at end of Hot Standby.
Diffstat (limited to 'src')
-rw-r--r--src/backend/storage/ipc/standby.c3
-rw-r--r--src/backend/storage/lmgr/lock.c3
-rw-r--r--src/include/storage/lock.h1
3 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/standby.c b/src/backend/storage/ipc/standby.c
index 9d2003867b5..7fd94f3e50a 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 32cc229c864..01834437467 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 d56f0fa4b74..e01a5c50443 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 */