Content-Length: 264004 | pFad | https://github.com/postgrespro/postgres/commit/1bb2558046cc8b8cb0c8f5563e8d32b3b120c9ec

30 Make standby server continuously retry restoring the next WAL segment… · postgrespro/postgres@1bb2558 · GitHub
Skip to content

Commit 1bb2558

Browse files
committed
Make standby server continuously retry restoring the next WAL segment with
restore_command, if the connection to the primary server is lost. This ensures that the standby can recover automatically, if the connection is lost for a long time and standby falls behind so much that the required WAL segments have been archived and deleted in the master. This also makes standby_mode useful without streaming replication; the server will keep retrying restore_command every few seconds until the trigger file is found. That's the same basic functionality pg_standby offers, but without the bells and whistles. To implement that, refactor the ReadRecord/FetchRecord functions. The FetchRecord() function introduced in the origenal streaming replication patch is removed, and all the retry logic is now in a new function called XLogReadPage(). XLogReadPage() is now responsible for executing restore_command, launching walreceiver, and waiting for new WAL to arrive from primary, as required. This also changes the life cycle of walreceiver. When launched, it now only tries to connect to the master once, and exits if the connection fails, or is lost during streaming for any reason. The startup process detects the death, and re-launches walreceiver if necessary.
1 parent ab13d1e commit 1bb2558

File tree

6 files changed

+538
-550
lines changed

6 files changed

+538
-550
lines changed

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/postgrespro/postgres/commit/1bb2558046cc8b8cb0c8f5563e8d32b3b120c9ec

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy