Skip to content

Commit f1e57a4

Browse files
Cleanup VirtualXact at end of Hot Standby.
1 parent 7a2fe9b commit f1e57a4

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
@@ -105,6 +105,9 @@ ShutdownRecoveryTransactionEnvironment(void)
105105

106106
/* Release all locks the tracked transactions were holding */
107107
StandbyReleaseAllLocks();
108+
109+
/* Cleanup our VirtualTransaction */
110+
VirtualXactLockTableCleanup();
108111
}
109112

110113

src/backend/storage/lmgr/lock.c

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

215214
/*
216215
* To make the fast-path lock mechanism work, we must have some way of
@@ -3791,7 +3790,7 @@ VirtualXactLockTableInsert(VirtualTransactionId vxid)
37913790
* Check whether a VXID lock has been materialized; if so, release it,
37923791
* unblocking waiters.
37933792
*/
3794-
static void
3793+
void
37953794
VirtualXactLockTableCleanup()
37963795
{
37973796
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy