Hi, Here is the newer version of the patch, based on the earlier v24 version shared by Bharath here: [1].
I have slightly simplified the patch, while preserving its original semantics. The patch introduces a timeout-based server parameter, "streaming_replication_retry_interval". When a standby has been reading WAL from the archive for the configured interval, it attempts to switch to streaming replication. Before doing so, it first ensures that all WAL already available under the pg_wal directory has been consumed. If streaming starts successfully, it continues using the streaming source. Otherwise, it falls back to archive recovery. Here is how the flow looks: ARCHIVE | | timeout v DRAIN LOCAL pg_wal | | no local WAL remains v STREAMING | | streaming fails v ARCHIVE Please have a look and let me know your thoughts. [1] - https://www.postgresql.org/message-id/CALj2ACVVM8c9pbCgmyxvViFy%3Df%3D%3DQNHhPFSGjvq0Sz7Y0beZsw%40mail.gmail.com -- With Regards, Ashutosh Sharma.
v25-0001-Allow-standby-to-switch-its-WAL-source-from-archive-.patch
Description: Binary data
