The beauty of walctl_setup is that it never needs to communicate with pg-primary at all. Everything this tool needs is in the /etc/walctl.conf file we created after installing walctl. By calling walctl_setup with the clone parameter, it performs three basic actions:
- Modifies archive_command in postgresql.conf to always produce a true value in case we ever need to change it to walctl_push later
- Removes any existing restore_command in recovery.conf
- Sets restore_command to walctl_pull with the necessary parameters
Did you notice that walctl_setup does not touch the primary_conninfo setting in recovery.conf? This means existing streaming standby servers will continue to operate as they always have. The only difference is that ...