8000 Cleanup VirtualXact at end of Hot Standby · danielcode/postgres@edfc84b · GitHub
[go: up one dir, main page]

Skip to content

Commit edfc84b

Browse files
Cleanup VirtualXact at end of Hot Standby
Resolves bug 7572 reported by Daniele Varrazzo
1 parent fdac4e2 commit edfc84b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/backend/storage/ipc/standby.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ ShutdownRecoveryTransactionEnvironment(void)
103103

104104
/* Release all locks the tracked transactions were holding */
105105
StandbyReleaseAllLocks();
106+
107+
/* Cleanup our VirtualTransaction */
108+
VirtualXactLockTableCleanup();
106109
}
107110

108111

src/backend/storage/lmgr/lock.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ static bool FastPathUnGrantRelationLock(Oid relid, LOCKMODE lockmode);
209209
static bool FastPathTransferRelationLocks(LockMethod lockMethodTable,
210210
const LOCKTAG *locktag, uint32 hashcode);
211211
static PROCLOCK *FastPathGetRelationLockEntry(LOCALLOCK *locallock);
212-
static void VirtualXactLockTableCleanup(void);
213212

214213
/*
215214
* To make the fast-path lock mechanism work, we must have some way of
@@ -3734,7 +3733,7 @@ VirtualXactLockTableInsert(VirtualTransactionId vxid)
37343733
* Check whether a VXID lock has been materialized; if so, release it,
37353734
* unblocking waiters.
37363735
*/
3737-
static void
3736+
void
37383737
VirtualXactLockTableCleanup()
37393738
{
37403739
bool fastpath;

src/include/storage/lock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ extern void DumpAllLocks(void);
544544

545545
/* Lock a VXID (used to wait for a transaction to finish) */
546546
extern void VirtualXactLockTableInsert(VirtualTransactionId vxid);
547+
extern void VirtualXactLockTableCleanup(void);
547548
extern bool VirtualXactLock(VirtualTransactionId vxid, bool wait);
548549

549550
#endif /* LOCK_H */

0 commit comments

Comments
 (0)
0