mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-22 22:56:29 +00:00
Ensure standby.signal is set correctly if -D/--data-directory supplied
When cloning a standby, it's possible to do a "raw" clone by providing -D/--data-directory but no repmgr.conf file. However the code which creates "standby.signal" was assuming the presence of a valid repmgr.conf complete with "data_directory" configuration. This is very much a niche-use case.
This commit is contained in:
@@ -2813,7 +2813,8 @@ do_node_rejoin(void)
|
||||
log_notice(_("temporarily removing \"standby.signal\""));
|
||||
log_detail(_("this is required so pg_rewind can fix the unclean shutdown"));
|
||||
|
||||
make_standby_signal_path(standby_signal_file_path);
|
||||
make_standby_signal_path(config_file_options.data_directory,
|
||||
standby_signal_file_path);
|
||||
|
||||
if (unlink(standby_signal_file_path) < 0 && errno != ENOENT)
|
||||
{
|
||||
@@ -2838,7 +2839,7 @@ do_node_rejoin(void)
|
||||
* of whether the pg_rewind operation failed.
|
||||
*/
|
||||
log_notice(_("recreating \"standby.signal\""));
|
||||
write_standby_signal();
|
||||
write_standby_signal(config_file_options.data_directory);
|
||||
}
|
||||
|
||||
if (ret == false)
|
||||
|
||||
Reference in New Issue
Block a user