Disable startup progress timeout during standby WAL replay

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Disable startup progress timeout during standby WAL replay
Date: 2026-06-11 00:13:45
Message-ID: CAHGQGwFJixYTymPZ6dwOO-G0VdjO1AgZTma6CtJgc0Ptxfz3BA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While working on a patch discussed in [1], I looked into how
log_startup_progress_interval behaves during recovery. During that
investigation, I noticed the following comment in
EnableStandbyMode():

/*
* To avoid server log bloat, we don't report recovery progress in a
* standby as it will always be in recovery unless promoted. We disable
* startup progress timeout in standby mode to avoid calling
* startup_progress_timeout_handler() unnecessarily.
*/

So in standby mode, we intentionally suppress recovery progress
logging during WAL replay, because otherwise a standby could emit
progress messages indefinitely until promotion.

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.

This does not seem to cause any user-visible issue, because standby
WAL replay does not emit recovery progress messages anyway. However,
the timeout still causes unnecessary periodic wakeups during
standby WAL replay.

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.

Thought?

Regards,

[1] https://postgr.es/m/44c24dcf-5710-410f-b1b6-d10b315f3d51@postgrespro.ru

--
Fujii Masao

Attachment Content-Type Size
v1-0001-Disable-startup-progress-timeout-during-standby-W.patch application/octet-stream 3.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-06-11 00:36:22 Re: DOCS - Add missing EXCEPT parameter description to ALTER PUBLICATION
Previous Message Peter Smith 2026-06-11 00:04:03 Re: Add pg_get_publication_ddl function