Re: Unnecessary delay in streaming replication due to replay lag

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: sunil s <sunilfeb26(at)gmail(dot)com>
Cc: Huansong Fu <huansong(dot)fu(dot)info(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Unnecessary delay in streaming replication due to replay lag
Date: 2025-10-27 13:16:20
Message-ID: CAHGQGwH7dqDvs1u1G6M-wkfjk3r=SD-ybTNZ9H_O11+xnGNW-w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 11, 2025 at 5:51 PM sunil s <sunilfeb26(at)gmail(dot)com> wrote:
>
> Hello Hackers,
>
> PFA rebased patch due to the code changes done in upstream commit 63599896545c7869f7dd28cd593e8b548983d613.
>
> The current status of the patch registered in Commit Fest is "Ready for Committer".

+ streamed WAL. Such environments can benefit from setting
+ <varname>wal_receiver_start_at</varname> to
+ <literal>startup</literal> or <literal>consistency</literal>. These
+ values will lead to the WAL receiver starting much earlier, and from
+ the end of locally available WAL.

When this parameter is set to 'startup' or 'consistency', what happens
if replication begins early and the startup process fails to replay
a WAL record—say, due to corruption—before reaching the replication
start point? In that case, the standby might fail to recover correctly
because of missing WAL records, while a transaction waiting for
synchronous replication may have already been acknowledged as committed.
Wouldn't that lead to a serious problem?

Regards,

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Jones 2025-10-27 13:21:39 Re: [PoC] XMLCast (SQL/XML X025)
Previous Message Álvaro Herrera 2025-10-27 13:10:07 Re: NLS: use gettext() to translate system error messages