From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: daniel@fdr.io
Subject: BUG #17577: pg_ctl promote is not preemptive in archive recovery
Date: Fri, 05 Aug 2022 18:30:36 +0000
Message-ID: <17577-cf743c9b3b9fd059@postgresql.org> (raw)
The following bug has been logged on the website:
Bug reference: 17577
Logged by: Daniel Farina
Email address: daniel@fdr.io
PostgreSQL version: 14.4
Operating system: AlmaLinux 8.6
Description:
Reproduction:
1) Back up a new, empty initdb server
2) Run pgbench in mixed mode for a while to generate WAL, possibly for
a long time.
3) Set up a replica
(Side note: In my case, though it may or may not be important, I
also have a primary_conninfo defined and standby.signal. The
primary_conninfo is not used, however, as the server never catches
up enough to do that before I run pg_ctl promote).
4) Wait for consistency. It should take a short while given the backup
is of an empty database.
5) try to run pg_ctl promote while the server is in archive restore
6) it will block until timeout, and not promote until restore_command exits
abnormally
Other notes:
upon running pg_ctl promote, the "promote" file is written, but the
"server has received promote request" message is not written to the
logs.
A workaround:
Killing the restore_command, i.e. injecting a non-zero exit code, will
cause postgres to print the "has received promote request" message and
go through promotion.
Probable cause: something is not checking for pg_ctl promote having
been run as often as it should when WAL is being sourced from
restore_command, but it does get checked when postgres does its
expected actions when receiving a non-zero exit code,
e.g. checking whether it should switch to streaming.
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-bugs@postgresql.org
Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, daniel@fdr.io
Subject: Re: BUG #17577: pg_ctl promote is not preemptive in archive recovery
In-Reply-To: <17577-cf743c9b3b9fd059@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