Skip to content

Commit 1899652

Browse files
committed
Revert "Add comment explaining why it is safe to use FirstNormalTransactionXid for oldestActiveXid while replica startup (#388)"
This reverts commit 79b6351.
1 parent 80cef88 commit 1899652

File tree

1 file changed

+6
-6
lines changed
  • src/backend/access/transam

1 file changed

+6
-6
lines changed

src/backend/access/transam/xlog.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5194,13 +5194,13 @@ StartupXLOG(void)
51945194
else if (!TransactionIdIsValid(checkPoint.oldestActiveXid))
51955195
{
51965196
/*
5197-
* Pageserver extracts oldestActiveXid from snapshot and running xacts WAL records
5198-
* and include it in checkpoint sent in basebackup.
5199-
* So oldestActiveXid can be zero only after database initialization when no checkpoints are yet performed
5200-
* and not running xacts records was logged.
5201-
* In this case it is possible to use FirstNormalTransactionId as safe conservative estimation
5202-
* of oldest active transaction XID.
5197+
* It should not actually happen: PS oldestActiveXid
5198+
* from running xacts WAL records and include it in checkpoint
5199+
* sent in basebackup.
5200+
* FirstNormalTransactionId is conservative estimation of oldest active XACT, unless
5201+
* current XID is greater than 1^31. So it is also not 100% safe solution but better than assertion failure.
52035202
*/
5203+
elog(FATAL, "oldestActiveXid=%d", checkPoint.oldestActiveXid);
52045204
checkPoint.oldestActiveXid = FirstNormalTransactionId;
52055205
}
52065206
}

0 commit comments

Comments
 (0)