pgsql: Switch to FATAL error for missing checkpoint record without back

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Switch to FATAL error for missing checkpoint record without back
Date: 2026-03-10 03:00:21
Message-ID: E1vznKX-003FXl-2E@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Switch to FATAL error for missing checkpoint record without backup_label

Crash recovery started without a backup_label previously crashed with a
PANIC if the checkpoint record could not be found. This commit lowers
the report generated to be a FATAL instead.

With recovery methods being more imaginative these days, this should
provide more flexibility when handling PostgreSQL recovery processing in
the event of a driver error, similarly to 15f68cebdcec. An extra
benefit of this change is that it becomes possible to add a test to
check that a FATAL is hit with an expected error message pattern. With
the recovery code becoming more complicated over the last couple of
years, I suspect that this will be benefitial to cover in the long-term.

The original PANIC behavior has been introduced in the early days of
crash recovery, as of 4d14fe0048cf (PANIC did not exist yet, the code
used STOP).

Author: Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAMm1aWZbQ-Acp_xAxC7mX9uZZMH8+NpfepY9w=AOxbBVT9E=uA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/03facc1211b0ff1550f41bcd4da09329080c30f9

Modified Files
--------------
src/backend/access/transam/xlogrecovery.c | 2 +-
src/test/recovery/meson.build | 1 +
.../recovery/t/052_checkpoint_segment_missing.pl | 59 ++++++++++++++++++++++
3 files changed, 61 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2026-03-10 12:58:20 pgsql: Allow extensions to mark an individual index as disabled.
Previous Message Michael Paquier 2026-03-09 22:06:23 pgsql: Fix misuse of "volatile" in xml.c