Re: [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion - Mailing list pgsql-hackers

From Roman Khapov
Subject Re: [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion
Date
Msg-id 2B425DAC-D16D-43FA-A7C5-BE88A2294967@yandex-team.ru
Whole thread Raw
In response to [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-hackers
> On 23 Oct 2025, at 21:25, Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>
> Hi hackers,
>
> I'd like to propose a new archive_mode setting to address a gap in WAL
> archiving for high availability streaming replication configurations.
>
> Best regards, Andrey Borodin.
> <v1-0001-Add-archive_mode-follow_primary-to-prevent-WAL-lo.patch>

Hi!

As discussed offline: there is one small part of your patch to improve - make
walsender send answer for every requested segments, not for the first 64
(still, walreceiver limits segments count to 64).

Also I noticed some improvement possibilities in test:

 - repeat logic of polling for several conditions across the test archive_follow_primary.pl,
seems like we need some general polling functions in PostgreSQL::Test::Utils?
I added poll_until, poll_cmd_until functions for that, and use them now in the test
(and also in poll_query_until, that was my inspiration)

 - there was some places that checks invariants that is always true:
done_files_appeared, standby2_done_found, standby3_done_found was checked for >= 0,
but initial value was 0, ready_files_found was polled but not verified, and also ready_count_after <=
ready_count_beforewas not checked correctly (in case polling was break by ’timeout’), I replaced 
all of them with more strictly checks, is that right, or I missed some points?

--
Best regards,
Roman Khapov



Attachment

pgsql-hackers by date:

Previous
From: Marcos Pegoraro
Date:
Subject: Re: Get rid of "Section.N.N.N" on DOCs
Next
From: Daniel Gustafsson
Date:
Subject: Re: ditaa --svg option is missing when building doc/src/sgml/images