Re: Disable startup progress timeout during standby WAL replay

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: masao(dot)fujii(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Disable startup progress timeout during standby WAL replay
Date: 2026-06-11 02:58:21
Message-ID: 20260611.115821.44187082609196749.horikyota.ntt@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello.

At Thu, 11 Jun 2026 09:13:45 +0900, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote in
> However, some startup operations executed afterward, such as
> ResetUnloggedRelations(), can re-enable the timeout. As a result, the
> startup progress timeout can remain active during standby WAL replay,
> which contradicts the intent described in the comment above.

Good catch.

> The attached patch disables the startup progress timeout again just
> before entering WAL replay in standby mode. This preserves progress
> reporting for earlier startup operations while avoiding unnecessary
> wakeups during standby replay. The patch also slightly clarifies the
> documentation for log_startup_progress_interval.
>
> I see this as a small cleanup/improvement for master rather than a bug
> fix requiring backpatching, since there is no visible behavioral issue
> for users.

I agree with that assessment.

I wonder whether we need to disable the startup progress timeout in
EnableStandbyMode() in the first place, if the intention is only to
suppress progress reporting during WAL replay on a standby.

It seems to me that the decision is more closely related to entering
the WAL replay phase than to enabling standby mode itself. Also, the
patch adds another StandbyMode check shortly before an existing one.

Wouldn't it be simpler to handle the standby case at the existing
check, like this?

if (!StandbyMode)
begin_startup_progress_phase();
+ else
+ disable_startup_progress_timeout();

If the timeout is no longer disabled in EnableStandbyMode(), this
would keep progress reporting for earlier startup phases, while making
it clearer in the code that the timeout is disabled when entering WAL
replay in standby mode.

Regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message cca5507 2026-06-11 03:03:17 Re: [BUG] Take a long time to reach consistent after pg_rewind
Previous Message Amit Kapila 2026-06-11 02:58:03 Re: DOCS - Add missing EXCEPT parameter description to ALTER PUBLICATION