Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1bb2558

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. Thisensures that the standby can recover automatically, if the connection islost for a long time and standby falls behind so much that the requiredWAL segments have been archived and deleted in the master.This also makes standby_mode useful without streaming replication; theserver will keep retrying restore_command every few seconds until thetrigger file is found. That's the same basic functionality pg_standbyoffers, but without the bells and whistles.To implement that, refactor the ReadRecord/FetchRecord functions. TheFetchRecord() function introduced in the original streaming replicationpatch is removed, and all the retry logic is now in a new function calledXLogReadPage(). XLogReadPage() is now responsible for executingrestore_command, launching walreceiver, and waiting for new WAL to arrivefrom primary, as required.This also changes the life cycle of walreceiver. When launched, it now onlytries to connect to the master once, and exits if the connection fails, oris lost during streaming for any reason. The startup process detects thedeath, and re-launches walreceiver if necessary.
1 parentab13d1e commit1bb2558

File tree

6 files changed

+538
-550
lines changed

6 files changed

+538
-550
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp