Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit49bff53

Browse files
Assign AccessExclusiveLocks against subxacts in Hot Standby
Previously AELs were registered against the top-level xid, which couldcause locks to be held much longer than necessary in some cases duringHot Standby replay. We now record locks directly against their appropriatexids. Requires few code changes because original code allowed for thissituation but didn’t fully implement it.Discussion: CAKJS1f9vJ841HY=wonnLVbfkTWGYWdPN72VMxnArcGCjF3SywA@mail.gmail.comAuthor: Simon Riggs and David Rowley
1 parent8df9bd0 commit49bff53

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎src/backend/storage/ipc/standby.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,6 @@ StandbyLockTimeoutHandler(void)
590590
* RelationLockList, so we can keep track of the various entries made by
591591
* the Startup process's virtual xid in the shared lock table.
592592
*
593-
* We record the lock against the top-level xid, rather than individual
594-
* subtransaction xids. This means AccessExclusiveLocks held by aborted
595-
* subtransactions are not released as early as possible on standbys.
596-
*
597593
* List elements use type xl_rel_lock, since the WAL record type exactly
598594
* matches the information that we need to keep track of.
599595
*
@@ -1052,7 +1048,7 @@ LogAccessExclusiveLock(Oid dbOid, Oid relOid)
10521048
{
10531049
xl_standby_lockxlrec;
10541050

1055-
xlrec.xid=GetTopTransactionId();
1051+
xlrec.xid=GetCurrentTransactionId();
10561052

10571053
/*
10581054
* Decode the locktag back to the original values, to avoid sending lots
@@ -1084,7 +1080,7 @@ LogAccessExclusiveLockPrepare(void)
10841080
* GetRunningTransactionLocks() might see a lock associated with an
10851081
* InvalidTransactionId which we later assert cannot happen.
10861082
*/
1087-
(void)GetTopTransactionId();
1083+
(void)GetCurrentTransactionId();
10881084
}
10891085

10901086
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp