Re: Report replication delay as unknown for down standby nodes

From: Nadav Shatz <nadav(at)tailorbrands(dot)com>
To: Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp>
Cc: "pgpool-hackers(at)lists(dot)postgresql(dot)org" <pgpool-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Report replication delay as unknown for down standby nodes
Date: 2026-09-02 06:07:17
Message-ID: CACeKOO0yONe+-19AZBRroEfiTZ_qNesN843DwdYfp-hr9T16VQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgpool-hackers

I think unknown is clear and better than 0 or last known.

Nadav Shatz
Tailor Brands | CTO

On Wed, Sep 2, 2026 at 3:15 AM Koshino Taiki <koshino(at)sraoss(dot)co(dot)jp> wrote:

> 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/
>
>

In response to

Responses

Browse pgpool-hackers by date

  From Date Subject
Next Message Roy, Dibyandu 2026-09-02 18:35:22 Proposal: PCP command for watchdog leader switchover (TODO: "Pgpool-II leader node switchover")
Previous Message Koshino Taiki 2026-09-02 00:15:03 Report replication delay as unknown for down standby nodes