Hi hackers!

Starting from v13 pg_rewind can use restore_command if it lacks necessary WAL 
segments. And this is awesome for HA clusters with many nodes! Thanks to 
everyone who worked on the feature!

Here's some feedback on how to make things even better.

If we run 'pg_rewind --restore-target-wal' there must be restore_command in 
config of target installation. But if the config is not within 
$PGDATA\postgresql.conf pg_rewind cannot use it.
If we run postmaster with `-c 
config_file=/etc/postgresql/10/data/postgresql.conf`, we simply cannot use the 
feature. We solved the problem by putting config into PGDATA only during 
pg_rewind, but this does not seem like a very robust solution.

Maybe we could add "-C, --target-restore-command=COMMAND  target WAL 
restore_command\n" as was proposed within earlier versions of the patch[0]? Or 
instruct pg_rewind to pass config to 'postgres -C restore_command' run?

From my POV adding --target-restore-command is simplest way, I can extract 
corresponding portions from original patch.

Thanks!

Best regards, Andrey Borodin.

[0] 
https://www.postgresql.org/message-id/flat/CAPpHfduUqKLr2CRpcpHcv1qjaz%2B-%2Bi9bOL2AOvdWSr954ti8Xw%40mail.gmail.com#1d4b372b5aa26f93af9ed1d5dd0693cd

Reply via email to