pgpool: Feature: Wait for follow_primary completion and report

From: Taiki Koshino <koshino(at)sraoss(dot)co(dot)jp>
To: pgpool-committers(at)lists(dot)postgresql(dot)org
Subject: pgpool: Feature: Wait for follow_primary completion and report
Date: 2026-04-15 00:29:19
Message-ID: E1wCo87-005n3A-1F@gothos.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-committers

Feature: Wait for follow_primary completion and report
failure in pcp_promote_node and enhence failover script.

This commit enhances the pcp_promote_node command to wait for
the completion of the follow_primary command triggered during
failover and enhance failover script.

Add pcp_follow_primary_wait and pcp_follow_primary_succeeded
members to Req_info. The pcp worker sets pcp_follow_primary_wait
to true before initiating failover and waits until it is cleared
by the follow_primary process.

The follow_primary execution side clears pcp_follow_primary_wait
when the processing finishes, and sets pcp_follow_primary_succeeded
to false if any error occurs during execution.

If follow_primary fails, pcp_promote_node reports an ERROR instead of
returning success, allowing users to detect failures directly from the
command result.

Enhance failover.sample.sh to checkpoint on old primary node before promote.

Branch
------
V4_7_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=ba0317d7d2dec2c8b1d4936a25c2a029d720c5a5

Modified Files
--------------
doc.ja/src/sgml/ref/pcp_watchdog_info.sgml | 11 ++++++++---
doc/src/sgml/ref/pcp_watchdog_info.sgml | 10 +++++++---
src/include/pcp/pcp.h | 1 +
src/include/watchdog/watchdog.h | 2 ++
src/include/watchdog/wd_commands.h | 2 ++
src/include/watchdog/wd_ipc_defines.h | 2 +-
src/include/watchdog/wd_lifecheck.h | 3 ++-
src/libs/pcp/pcp.c | 6 ++++++
src/tools/pcp/pcp_frontend_client.c | 8 +++++---
src/watchdog/watchdog.c | 13 +++++++++++++
src/watchdog/wd_commands.c | 7 +++++++
src/watchdog/wd_json_data.c | 4 +++-
src/watchdog/wd_lifecheck.c | 10 +++++++++-
13 files changed, 66 insertions(+), 13 deletions(-)

Browse pgpool-committers by date

  From Date Subject
Next Message Taiki Koshino 2026-04-15 00:47:04 pgpool: Feature: Wait for follow_primary completion and report
Previous Message Bo Peng 2026-04-09 03:12:24 pgpool: Fix version mismatch: regenerate configure for 4.4.16.