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

Commit578a7fe

Browse files
committed
Update TransactionXmin when MyProc->xmin is updated
GetSnapshotData() set TransactionXmin = MyProc->xmin, but whenSnapshotResetXmin() advanced MyProc->xmin, it did not advanceTransactionXmin correspondingly. That meant that TransactionXmin couldbe older than MyProc->xmin, and XIDs between than TransactionXmin andthe real MyProc->xmin could be vacuumed away. One known consequence isin pg_subtrans lookups: we might try to look up the status of an XIDthat was already truncated away.Back-patch to all supported versions.Reviewed-by: Andres FreundDiscussion:https://www.postgresql.org/message-id/d27a046d-a1e4-47d1-a95c-fbabe41debb4@iki.fi
1 parentdb448ce commit578a7fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/utils/time/snapmgr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -875,15 +875,15 @@ SnapshotResetXmin(void)
875875

876876
if (pairingheap_is_empty(&RegisteredSnapshots))
877877
{
878-
MyProc->xmin=InvalidTransactionId;
878+
MyProc->xmin=TransactionXmin=InvalidTransactionId;
879879
return;
880880
}
881881

882882
minSnapshot=pairingheap_container(SnapshotData,ph_node,
883883
pairingheap_first(&RegisteredSnapshots));
884884

885885
if (TransactionIdPrecedes(MyProc->xmin,minSnapshot->xmin))
886-
MyProc->xmin=minSnapshot->xmin;
886+
MyProc->xmin=TransactionXmin=minSnapshot->xmin;
887887
}
888888

889889
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp