Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit efbdcbd

Browse files
author
Alexander Korotkov
committed
Fix calculation of RecentGlobalXmin with 64-bit xids assuming there is no wraparound.
1 parent 0209726 commit efbdcbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/storage/ipc/procarray.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,9 +1798,10 @@ GetSnapshotData(Snapshot snapshot)
17981798
globalxmin = xmin;
17991799

18001800
/* Update global variables too */
1801-
RecentGlobalXmin = globalxmin - vacuum_defer_cleanup_age;
1802-
if (!TransactionIdIsNormal(RecentGlobalXmin))
1801+
if (globalxmin <= FirstNormalTransactionId + vacuum_defer_cleanup_age)
18031802
RecentGlobalXmin = FirstNormalTransactionId;
1803+
else
1804+
RecentGlobalXmin = globalxmin - vacuum_defer_cleanup_age;
18041805

18051806
/* Check whether there's a replication slot requiring an older xmin. */
18061807
if (TransactionIdIsValid(replication_slot_xmin) &&

0 commit comments

Comments
 (0)