pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Switch to FATAL error for missing checkpoint record without back
Date: Tue, 10 Mar 2026 03:00:21 +0000
Message-ID: <E1vznKX-003FXl-2E@gemulon.postgresql.org> (raw)

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@gmail.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(-)



Message-ID: <E1vznKX-003FXl-2E@gemulon.postgresql.org>
Permalink:  ../E1vznKX-003FXl-2E@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1vznKX-003FXl-2E@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Switch to FATAL error for missing checkpoint record without back
  In-Reply-To: <E1vznKX-003FXl-2E@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox