xlogrecovery.c:WaitForWALToBecomeAvailable() - make "switched WAL source" visible by default?

From: Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: xlogrecovery.c:WaitForWALToBecomeAvailable() - make "switched WAL source" visible by default?
Date: 2025-05-15 07:57:01
Message-ID: CAKZiRmwFRsSVD56WrtB+8s17kC6xzq3YKQhp9FxpRnqqh1yFfw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

In presence of restore_command being configured, physical standby can
either use it to restore archive logs to get WAL OR we can stream WAL
from the primary. If we are streaming from primary we get: "started
streaming WAL from primary" clear log message. In case of using
restore_command we do not get anything, that is: we can get "restored
log file XXX from archive", but only AFTER it has been done. It is not
that clear if the restore_command hangs (and there's no toggle or
option to set timeout for such command). Therefore wouldn't it make
some sense to alter xlogrecovery.c:WaitForWALToBecomeAvailable() to
add more information to the logs like below? Thoughts?

if (currentSource != oldSource)
- elog(DEBUG2, "switched WAL source from %s to
%s after %s",
+ elog(LOG, "switched WAL source from %s to %s after %s",

-J.

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiro Ikeda 2025-05-15 08:52:06 Assertion failure in smgr.c when using pg_prewarm with partitioned tables
Previous Message Andrei Lepikhov 2025-05-15 07:54:35 Re: Should we optimize the `ORDER BY random() LIMIT x` case?