mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-25 08:06:29 +00:00
Consolidate final output of "standby follow" / "node rejoin"
This commit is contained in:
@@ -927,10 +927,13 @@ do_node_rejoin(void)
|
||||
|
||||
PQExpBufferData command;
|
||||
PQExpBufferData command_output;
|
||||
PQExpBufferData follow_output;
|
||||
struct stat statbuf;
|
||||
char filebuf[MAXPGPATH] = "";
|
||||
t_node_info primary_node_record = T_NODE_INFO_INITIALIZER;
|
||||
|
||||
bool success;
|
||||
|
||||
/* check node is not actually running */
|
||||
|
||||
status = PQping(config_file_options.conninfo);
|
||||
@@ -1069,8 +1072,36 @@ do_node_rejoin(void)
|
||||
}
|
||||
}
|
||||
|
||||
do_standby_follow_internal(upstream_conn, &primary_node_record);
|
||||
initPQExpBuffer(&follow_output);
|
||||
|
||||
success = do_standby_follow_internal(
|
||||
upstream_conn,
|
||||
&primary_node_record,
|
||||
&follow_output);
|
||||
|
||||
create_event_notification(
|
||||
upstream_conn,
|
||||
&config_file_options,
|
||||
config_file_options.node_id,
|
||||
"node_rejoin",
|
||||
success,
|
||||
follow_output.data);
|
||||
|
||||
PQfinish(upstream_conn);
|
||||
|
||||
if (success == false)
|
||||
{
|
||||
log_notice(_("NODE REJOIN failed"));
|
||||
log_detail("%s", follow_output.data);
|
||||
|
||||
termPQExpBuffer(&follow_output);
|
||||
exit(ERR_DB_QUERY);
|
||||
}
|
||||
|
||||
log_notice(_("NODE REJOIN successful"));
|
||||
log_detail("%s", follow_output.data);
|
||||
|
||||
termPQExpBuffer(&follow_output);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user