mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 16:46:28 +00:00
repmgrd: tweak log notices when marking a standby as failed
Announce what we're going to do (set the node record inactive) *before* performing the action. Makes reading the log slightly easier.
This commit is contained in:
@@ -1001,30 +1001,36 @@ loop:
|
|||||||
{
|
{
|
||||||
if (PQstatus(primary_conn) == CONNECTION_OK)
|
if (PQstatus(primary_conn) == CONNECTION_OK)
|
||||||
{
|
{
|
||||||
if (update_node_record_set_active(primary_conn, local_node_info.node_id, false) == true)
|
PQExpBufferData event_details;
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
|
initPQExpBuffer(&event_details);
|
||||||
|
|
||||||
|
local_node_info.active = false;
|
||||||
|
|
||||||
|
appendPQExpBuffer(&event_details,
|
||||||
|
_("unable to connect to local node \"%s\" (ID: %i), marking inactive"),
|
||||||
|
local_node_info.node_name,
|
||||||
|
local_node_info.node_id);
|
||||||
|
|
||||||
|
log_notice("%s", event_details.data);
|
||||||
|
|
||||||
|
if (update_node_record_set_active(primary_conn, local_node_info.node_id, false) == false)
|
||||||
{
|
{
|
||||||
PQExpBufferData event_details;
|
success = false;
|
||||||
|
log_warning(_("unable to mark node \"%s\" (ID: %i) as inactive"),
|
||||||
initPQExpBuffer(&event_details);
|
local_node_info.node_name,
|
||||||
|
local_node_info.node_id);
|
||||||
local_node_info.active = false;
|
|
||||||
|
|
||||||
appendPQExpBuffer(&event_details,
|
|
||||||
_("unable to connect to local node \"%s\" (ID: %i), marking inactive"),
|
|
||||||
local_node_info.node_name,
|
|
||||||
local_node_info.node_id);
|
|
||||||
|
|
||||||
log_warning("%s", event_details.data);
|
|
||||||
|
|
||||||
create_event_notification(primary_conn,
|
|
||||||
&config_file_options,
|
|
||||||
local_node_info.node_id,
|
|
||||||
"standby_failure",
|
|
||||||
false,
|
|
||||||
event_details.data);
|
|
||||||
|
|
||||||
termPQExpBuffer(&event_details);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
create_event_notification(primary_conn,
|
||||||
|
&config_file_options,
|
||||||
|
local_node_info.node_id,
|
||||||
|
"standby_failure",
|
||||||
|
success,
|
||||||
|
event_details.data);
|
||||||
|
|
||||||
|
termPQExpBuffer(&event_details);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user