Report replication delay as unknown for down standby nodes

From: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
To: "pgpool-hackers(at)lists(dot)postgresql(dot)org" <pgpool-hackers(at)lists(dot)postgresql(dot)org>
Subject: Report replication delay as unknown for down standby nodes
Date: 2026-09-02 00:15:03
Message-ID: OS9P286MB64866DDA8127963C3FE4E6BF94A82@OS9P286MB6486.JPNP286.PROD.OUTLOOK.COM
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

Hi,

I investigated and reproduced the replication delay reporting issue
reported here:

https://github.com/pgpool/pgpool2/issues/131

After generating replication delay and detaching the standby,
SHOW POOL_NODES and pcp_node_info continued to report the last measured
value:

status | pg_status | replication_delay
-------+-----------+------------------
down | up | 72354928

Since the delay cannot be measured while the standby is down, this patch
reports it as "unknown" in both commands:

status | pg_status | replication_delay
-------+-----------+------------------
down | up | unknown

localhost 11003 ... down up standby standby unknown streaming async

The stored value is left unchanged to avoid treating an unmeasured delay
as zero when the standby is attached again.

I also updated the expected output of the 003.failover regression test,
and the test passes.

Do you think "unknown" is the appropriate output, or would zero or the
last measured value be preferable?

The patch is attached.

Regards,
Taiki Koshino

Taiki Koshino<koshino(at)sraoss(dot)co(dot)jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/

Attachment Content-Type Size
v1-0001-Report-replication-delay-as-unknown-for-down-stan.patch application/octet-stream 4.7 KB

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Nadav Shatz 2026-09-02 06:07:17 Re: Report replication delay as unknown for down standby nodes
Previous Message Koshino Taiki 2026-09-01 07:27:42 Re: Convert pcp_exit_handler and wakeup_handler_parent to flag-only.