Thanks for the review! On Tue, Feb 17, 2026 at 9:38 AM Kirill Reshke <[email protected]> wrote: > This does not immediately strike me as good reasoning. We have, for > example, pg_stat_get_wal_senders (or WalSndInitStopping from > walsenders.h) function which accesses exactly WalSndCtl->walsnds. > Why don't we simply have another utility function that will return the > number of active walsenders?
That's true it is an option. I've switched to this approach and created a WalSndRunning. We only need to know if there's at least one wal sender running, no need to have a precise number. I've also added StandbyMode as a condition to restrict this to replicas. XLogPageRead may be used by the primary when starting up, and will likely re-read the WAL so releasing cached pages should be avoided on the primary.
v3-0001-Don-t-keep-closed-WAL-segments-in-page-cache-afte.patch
Description: Binary data
