mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
44
repmgr.c
44
repmgr.c
@@ -2859,6 +2859,13 @@ do_standby_follow(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* XXX add event record - possible move from repmgrd? */
|
/* XXX add event record - possible move from repmgrd? */
|
||||||
|
create_event_record(master_conn,
|
||||||
|
&options,
|
||||||
|
options.node,
|
||||||
|
"standby_follow",
|
||||||
|
true,
|
||||||
|
NULL);
|
||||||
|
|
||||||
PQfinish(master_conn);
|
PQfinish(master_conn);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -3572,9 +3579,20 @@ do_standby_switchover(void)
|
|||||||
|
|
||||||
if (query_result == -1)
|
if (query_result == -1)
|
||||||
{
|
{
|
||||||
log_err(_("unable to retrieve replication status for node %i\n"), remote_node_id);
|
PQExpBufferData event_details;
|
||||||
|
initPQExpBuffer(&event_details);
|
||||||
|
appendPQExpBuffer(&event_details,
|
||||||
|
_("unable to retrieve replication status for node %i"),
|
||||||
|
remote_node_id);
|
||||||
|
log_err("%s\n", event_details.data);
|
||||||
|
create_event_record(local_conn,
|
||||||
|
&options,
|
||||||
|
options.node,
|
||||||
|
"standby_switchover",
|
||||||
|
false,
|
||||||
|
event_details.data);
|
||||||
|
termPQExpBuffer(&event_details);
|
||||||
PQfinish(local_conn);
|
PQfinish(local_conn);
|
||||||
|
|
||||||
exit(ERR_SWITCHOVER_FAIL);
|
exit(ERR_SWITCHOVER_FAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3598,8 +3616,19 @@ do_standby_switchover(void)
|
|||||||
* - backup
|
* - backup
|
||||||
* - UNKNOWN
|
* - UNKNOWN
|
||||||
*/
|
*/
|
||||||
log_err(_("node %i has unexpected replication state \"%s\"\n"),
|
PQExpBufferData event_details;
|
||||||
remote_node_id, remote_node_replication_state);
|
initPQExpBuffer(&event_details);
|
||||||
|
appendPQExpBuffer(&event_details,
|
||||||
|
_("node %i has unexpected replication state \"%s\""),
|
||||||
|
remote_node_id, remote_node_replication_state);
|
||||||
|
log_err("%s\n", event_details.data);
|
||||||
|
create_event_record(local_conn,
|
||||||
|
&options,
|
||||||
|
options.node,
|
||||||
|
"standby_switchover",
|
||||||
|
false,
|
||||||
|
event_details.data);
|
||||||
|
termPQExpBuffer(&event_details);
|
||||||
PQfinish(local_conn);
|
PQfinish(local_conn);
|
||||||
exit(ERR_SWITCHOVER_FAIL);
|
exit(ERR_SWITCHOVER_FAIL);
|
||||||
}
|
}
|
||||||
@@ -3656,6 +3685,13 @@ do_standby_switchover(void)
|
|||||||
|
|
||||||
/* TODO: verify this node's record was updated correctly */
|
/* TODO: verify this node's record was updated correctly */
|
||||||
|
|
||||||
|
create_event_record(local_conn,
|
||||||
|
&options,
|
||||||
|
options.node,
|
||||||
|
"standby_switchover",
|
||||||
|
true,
|
||||||
|
NULL);
|
||||||
|
|
||||||
PQfinish(local_conn);
|
PQfinish(local_conn);
|
||||||
|
|
||||||
log_notice(_("switchover was successful\n"));
|
log_notice(_("switchover was successful\n"));
|
||||||
|
|||||||
Reference in New Issue
Block a user