> On 22 Dec 2025, at 19:10, Roman Khapov <[email protected]> wrote:
> 
> some improvement possibilities

Hi John, Fujii, Roman, Kirill and everyone who commented,

Thanks for the feedback on the follow_primary patch!
Your suggestions pointed toward a simpler design.

John: You suggested having the primary send last_archived_wal instead of the 
standby scanning archive_status. That matches the “shared” archive design: the 
primary pushes archive status over the replication protocol, so the standby 
never needs to scan or query.

Fujii: You suggested coordinating via pg_stat_archiver on the primary instead 
of hitting storage. The shared archive approach does exactly that: coordination 
stays inside the cluster via the replication protocol, with no extra storage 
requests.

I’ve started implementing this in Heikki Linnakangas’s old thread (2014), where 
the “shared” archive idea was originally proposed: 
https://www.postgresql.org/message-id/flat/D4B53AE3-B7AF-4BE6-9CB6-44956B05DE72%40yandex-team.ru#819292ccc2235cfb5d417d2925517664

The design: primary sends archive status reports; standby creates .ready for 
received WAL and marks .done only after it gets confirmation. No 
standby-initiated queries, no directory scans on the standby, no extra storage 
calls.

I posted the implementation there and will circle back to this thread when 
there’s an update. Or do you think it ouwld be more appropriate to work in this 
thread?


Best regards, Andrey Borodin.

Reply via email to