From: Taiki Koshino <koshino@sraoss.co.jp>
To: pgpool-committers@lists.postgresql.org
Subject: pgpool: Feature: Wait for follow_primary completion and report failure
Date: Fri, 13 Nov 2026 02:25:26 +0000
Message-ID: <E1xRgyk-00000003feU-1hB3@gothos.postgresql.org> (raw)
Feature: Wait for follow_primary completion and report failure in pcp_promote_node.
This commit enhances the pcp_promote_node command to wait for completion of failover
and follow_primary processing, and reports which script failed when an error occurs
in the failover or follow_primary script.
Add pcp_promote_node_wait and pcp_promote_failed_command members to Req_info.
The PCP worker sets pcp_promote_node_wait to true before initiating failover
and waits until it becomes false by the failover or follow_primary execution side.
The failover and follow_primary execution side set pcp_promote_node_wait to false
when processing finishes. If an error occurs during script execution, they store
the failed command in pcp_promote_failed_command.
If failover or follow_primary command execution fails, pcp_promote_node reports
an ERROR with the failed command instead of returning success, allowing users
to detect failures directly from the command result.
Discussion: https://github.com/pgpool/pgpool2/issues/147
Branch
------
master
Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=e780d9f784021a1c5fb349104f63e542f1e18...
Modified Files
--------------
src/include/pool.h | 5 +
src/main/pgpool_main.c | 17 ++
src/pcp_con/pcp_worker.c | 30 +++
src/test/regression/tests/034.promote_node/test.sh | 180 ++++++++++++++-
src/test/regression/tests/046.detach_node/test.sh | 257 +++++++++++++++++++++
.../tests/127.invalid_failover_node/test.sh | 2 +-
6 files changed, 487 insertions(+), 4 deletions(-)
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgpool-committers@postgresql.org
Cc: koshino@sraoss.co.jp
Subject: Re: pgpool: Feature: Wait for follow_primary completion and report failure
In-Reply-To: <E1xRgyk-00000003feU-1hB3@gothos.postgresql.org>
References: <E1xRgyk-00000003feU-1hB3@gothos.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