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

Commit7cfdb4d

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 parent0350b87 commit7cfdb4d

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
@@ -920,15 +920,15 @@ SnapshotResetXmin(void)
920920

921921
if (pairingheap_is_empty(&RegisteredSnapshots))
922922
{
923-
MyProc->xmin=InvalidTransactionId;
923+
MyProc->xmin=TransactionXmin=InvalidTransactionId;
924924
return;
925925
}
926926

927927
minSnapshot=pairingheap_container(SnapshotData,ph_node,
928928
pairingheap_first(&RegisteredSnapshots));
929929

930930
if (TransactionIdPrecedes(MyProc->xmin,minSnapshot->xmin))
931-
MyProc->xmin=minSnapshot->xmin;
931+
MyProc->xmin=TransactionXmin=minSnapshot->xmin;
932932
}
933933

934934
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp