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

Commit05e0aff

Browse files
committed
Fix nextXid tracking bug on standbys (9.5-11 only).
RecordKnownAssignedTransactionIds() should never movenextXid backwards. Before this commit, that could happenif some other code path had advanced it without advancinglatestObservedXid.One consequence is that a well timed XLOG_CHECKPOINT_ONLINEcould cause hot standby feedback messages to get confusedand report an xmin from a future epoch, potentially allowingvacuum to run too soon on the primary.Repair, by making sure RecordKnownAssignedTransactionIds()can only move nextXid forwards.In release 12 and master, this was already done by commit2fc7af5, which consolidated similar code and straightenedout this bug. Back-patch to supported releases before that.Author: Eka Palamadai <ekanatha@amazon.com>Discussion:https://postgr.es/m/98BB4805-D0A2-48E1-96F4-15014313EADC@amazon.com
1 parent064e029 commit05e0aff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3248,7 +3248,8 @@ RecordKnownAssignedTransactionIds(TransactionId xid)
32483248
next_expected_xid=latestObservedXid;
32493249
TransactionIdAdvance(next_expected_xid);
32503250
LWLockAcquire(XidGenLock,LW_EXCLUSIVE);
3251-
ShmemVariableCache->nextXid=next_expected_xid;
3251+
if (TransactionIdFollows(next_expected_xid,ShmemVariableCache->nextXid))
3252+
ShmemVariableCache->nextXid=next_expected_xid;
32523253
LWLockRelease(XidGenLock);
32533254
}
32543255
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp