Skip to content

Commit 741bd32

Browse files
committed
Improve errors related to incorrect TLI on checkpoint record replay
WAL replay would cause a hard crash if the timeline expected by a XLOG_END_OF_RECOVERY, a XLOG_CHECKPOINT_ONLINE, or a XLOG_CHECKPOINT_SHUTDOWN record is not the same as the timeline being replayed, using the same error message for all three of them. This commit changes those error messages to use different wordings, adapted to each record type, which is useful when it comes to the debugging of an issue in this area. Author: Amul Sul Reviewed-by: Nathan Bossart, Robert Haas Discussion: https://postgr.es/m/CAAJ_b97i1ZerYC_xW6o_AiDSW5n+sGi8k91Yc8KS8bKWKxjqwQ@mail.gmail.com
1 parent 410aa24 commit 741bd32

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

src/backend/access/transam/xlog.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -10421,7 +10421,7 @@ xlog_redo(XLogReaderState *record)
1042110421
*/
1042210422
if (checkPoint.ThisTimeLineID != replayTLI)
1042310423
ereport(PANIC,
10424-
(errmsg("unexpected timeline ID %u (should be %u) in checkpoint record",
10424+
(errmsg("unexpected timeline ID %u (should be %u) in shutdown checkpoint record",
1042510425
checkPoint.ThisTimeLineID, replayTLI)));
1042610426

1042710427
RecoveryRestartPoint(&checkPoint, record);
@@ -10477,7 +10477,7 @@ xlog_redo(XLogReaderState *record)
1047710477
/* TLI should not change in an on-line checkpoint */
1047810478
if (checkPoint.ThisTimeLineID != replayTLI)
1047910479
ereport(PANIC,
10480-
(errmsg("unexpected timeline ID %u (should be %u) in checkpoint record",
10480+
(errmsg("unexpected timeline ID %u (should be %u) in online checkpoint record",
1048110481
checkPoint.ThisTimeLineID, replayTLI)));
1048210482

1048310483
RecoveryRestartPoint(&checkPoint, record);
@@ -10507,7 +10507,7 @@ xlog_redo(XLogReaderState *record)
1050710507
*/
1050810508
if (xlrec.ThisTimeLineID != replayTLI)
1050910509
ereport(PANIC,
10510-
(errmsg("unexpected timeline ID %u (should be %u) in checkpoint record",
10510+
(errmsg("unexpected timeline ID %u (should be %u) in end-of-recovery record",
1051110511
xlrec.ThisTimeLineID, replayTLI)));
1051210512
}
1051310513
else if (info == XLOG_NOOP)

0 commit comments

Comments
 (0)