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

From Fujii Masao
Subject Re: [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion
Date
Msg-id CAHGQGwFP8i6s0+Xivmvtf-LS-DkJb-znzYZpi8NzWCqzLxK-+g@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Add archive_mode=follow_primary to prevent unarchived WAL on standby promotion  (Andrey Borodin <x4mmm@yandex-team.ru>)
List pgsql-hackers
On Sat, Nov 1, 2025 at 3:14 AM Andrey Borodin <x4mmm@yandex-team.ru> wrote:
> Many storages charge for request. If archive tool issues HEAD request to S3 - it might costs user some money.
> Other storages cap frequency of requests at some RPS. In worst case we might affect archiving capabilities of
primary.
>
> The key idea here is that archive storage might be a disaster recovery system that is optimized for storing data, but
notfor listing this data frequently. So the cluster should not delegate archive_status function to some distant storage
ifit can be cheaply tracked within HA cluster internally. 

Just idea, as another approach, we could check whether the specified WAL file
has already been archived, by querying pg_stat_archiver on the primary,
instead of sending a request to the storage service. So, it seems we could set
the standby's archive_command to a script that performs this check
via pg_stat_archiver to achieve the same goal. Thoughts?

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Alexander Lakhin
Date:
Subject: Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs
Next
From: Shubham Khanna
Date:
Subject: Re: Add support for specifying tables in pg_createsubscriber.