Skip to content

Commit 057ea34

Browse files
committed
Xmin calculations should consider only top transaction IDs, and
therefore starting with GetCurrentTransactionId is wrong. Fixes miscomputation of RecentGlobalXmin leading to bizarre behavior reported by Gavin Sherry.
1 parent 2820f05 commit 057ea34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/backend/storage/ipc/sinval.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.67 2004/08/01 17:32:16 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/storage/ipc/sinval.c,v 1.68 2004/08/15 17:03:36 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -673,7 +673,7 @@ GetOldestXmin(bool allDbs)
673673
TransactionId result;
674674
int index;
675675

676-
result = GetCurrentTransactionId();
676+
result = GetTopTransactionId();
677677

678678
LWLockAcquire(SInvalLock, LW_SHARED);
679679

@@ -763,7 +763,7 @@ GetSnapshotData(Snapshot snapshot, bool serializable)
763763
errmsg("out of memory")));
764764
}
765765

766-
globalxmin = xmin = GetCurrentTransactionId();
766+
globalxmin = xmin = GetTopTransactionId();
767767

768768
/*
769769
* If we are going to set MyProc->xmin then we'd better get exclusive

0 commit comments

Comments
 (0)