Hi, On Wed, 23 Sept 2026 at 12:51, Ashutosh Sharma <[email protected]> wrote: > > 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. > > Please have a look and let me know your thoughts.
I want to talk about another approach. Could the standby report its progress to the primary while it is replaying WAL from the archive, without having to switch to streaming first? The idea is to keep walreceiver running in a feedback-only mode while recovery reads from the archive or local pg_wal. It would connect to the primary and send periodic updates. If the primary were unreachable, archive recovery could continue while walreceiver retries. The main benefits I can think of are: 1. If the streaming is preferred and available, the standby can switch directly to streaming [*]. Feedback-only mode is useful when restoring from the archive is faster, or when the primary is reachable but streaming no longer works. 2. WAL position updates could advance the slot’s restart_lsn, so the primary would not retain WAL for that slot because streaming has not resumed. This helps synchronized_standby_slots as well. 3. When hot_standby_feedback is enabled, the same connection could report which row versions standby queries still need. This could help prevent query cancellations. [*] I think this could work alongside v25: periodic retries decide when to switch back to streaming, while feedback-only mode lets the standby report progress until that switch succeeds. At least one trade-off is that the proposed approach is more complicated than v25. What do you think? Do you think this idea is worth to pursue? -- Regards, Nazir Bilal Yavuz Microsoft
