How to make sure that all required wal files are availables before starting a standby server?
0
votes
1
answer
328
views
Im writing a script to restore a postgres standby server that was out of sync with the master node for a while.
I would like the following behavior
1. Check if i can go with pg_rewind
2. If pg_rewind fails, then use pg_basebackup
The big deal for me is about the pg_rewind because even if pg_rewind succeeds, it does not guarantee that the standby server will start successfully. In some cases the standby server needs some old wal file of the master (which can be provided using
) and if it is not found, you get this : : requested WAL segment 00000002000000050000007C has already been removed
So i would like, in addition to pg_rewind successful response, to find a way to ensure that every wal file that will be required on server startup is already available before starting the server. And if it is not available, I continue directly with the second option (perform a full backup with pg_basebackup)
Any help ...
Asked by meilleureVie
(1 rep)
Nov 7, 2023, 03:25 AM
Last activity: May 15, 2025, 02:06 AM
Last activity: May 15, 2025, 02:06 AM