Re: Switching XLog source from archive to streaming when primary available - Mailing list pgsql-hackers

From Ashutosh Sharma
Subject Re: Switching XLog source from archive to streaming when primary available
Date
Msg-id CAE9k0Pkfx3+BD1=tzRCZxUv9ChN03J591pnGwBhXaJSsNB8iBg@mail.gmail.com
Whole thread
In response to Re: Switching XLog source from archive to streaming when primary available  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
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.

Attachment

pgsql-hackers by date:

Previous
From: Yuhang Qiu
Date:
Subject: [PATCH] Add ALTER SYSTEM RELOAD
Next
From: Jeevan Chalke
Date:
Subject: Re: Use-after-free of a shared Path in add_path()/add_partial_path()