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

Commitd0d58f7

Browse files
Clarify docs on hot standby lock release
Andres Freund and Simon Riggs
1 parent634e148 commitd0d58f7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,6 +1413,11 @@ GetSnapshotData(Snapshot snapshot)
14131413
* We don't worry about updating other counters, we want to keep this as
14141414
* simple as possible and leave GetSnapshotData() as the primary code for
14151415
* that bookkeeping.
1416+
*
1417+
* Note that if any transaction has overflowed its cached subtransactions
1418+
* then there is no real need include any subtransactions. That isn't a
1419+
* common enough case to worry about optimising the size of the WAL record,
1420+
* and we may wish to see that data for diagnostic purposes anyway.
14161421
*/
14171422
RunningTransactions
14181423
GetRunningTransactionData(void)

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,10 @@ CheckRecoveryConflictDeadlock(void)
509509
* RelationLockList, so we can keep track of the various entries made by
510510
* the Startup process's virtual xid in the shared lock table.
511511
*
512+
* We record the lock against the top-level xid, rather than individual
513+
* subtransaction xids. This means AccessExclusiveLocks held by aborted
514+
* subtransactions are not released as early as possible on standbys.
515+
*
512516
* List elements use type xl_rel_lock, since the WAL record type exactly
513517
* matches the information that we need to keep track of.
514518
*
@@ -642,8 +646,8 @@ StandbyReleaseAllLocks(void)
642646

643647
/*
644648
* StandbyReleaseOldLocks
645-
*Release standby locks held by XIDs that aren't running, as long
646-
*as they're not prepared transactions.
649+
*Release standby locks held bytop-levelXIDs that aren't running,
650+
*aslong asthey're not prepared transactions.
647651
*/
648652
void
649653
StandbyReleaseOldLocks(intnxids,TransactionId*xids)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp