mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
repmgr standby switchover: add event details
This commit is contained in:
@@ -1971,14 +1971,11 @@ do_standby_follow_internal(PGconn *primary_conn, t_node_info *primary_node_recor
|
|||||||
* - promoting this standby node to primary
|
* - promoting this standby node to primary
|
||||||
* - forcing previous primary node to follow this node
|
* - forcing previous primary node to follow this node
|
||||||
*
|
*
|
||||||
* Caveats:
|
* Caveat:
|
||||||
* - repmgrd must not be running, otherwise it may
|
* - repmgrd must not be running, otherwise it may
|
||||||
* attempt a failover
|
* attempt a failover
|
||||||
* (TODO: find some way of notifying repmgrd of planned
|
* (TODO: find some way of notifying repmgrd of planned
|
||||||
* activity like this)
|
* activity like this)
|
||||||
* - currently only set up for two-node operation; any other
|
|
||||||
* standbys will probably become downstream cascaded standbys
|
|
||||||
* of the old primary once it's restarted
|
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
* - make connection test timeouts/intervals configurable (see below)
|
* - make connection test timeouts/intervals configurable (see below)
|
||||||
@@ -2819,12 +2816,22 @@ do_standby_switchover(void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
PQExpBufferData event_details;
|
||||||
|
|
||||||
|
initPQExpBuffer(&event_details);
|
||||||
|
|
||||||
|
appendPQExpBuffer(&event_details,
|
||||||
|
"node %i promoted to primary, node %i demoted to standby",
|
||||||
|
config_file_options.node_id,
|
||||||
|
remote_node_record.node_id);
|
||||||
|
|
||||||
create_event_record(local_conn,
|
create_event_record(local_conn,
|
||||||
&config_file_options,
|
&config_file_options,
|
||||||
config_file_options.node_id,
|
config_file_options.node_id,
|
||||||
"standby_switchover",
|
"standby_switchover",
|
||||||
true,
|
true,
|
||||||
NULL);
|
event_details.data);
|
||||||
|
termPQExpBuffer(&event_details);
|
||||||
}
|
}
|
||||||
|
|
||||||
termPQExpBuffer(&command_output);
|
termPQExpBuffer(&command_output);
|
||||||
@@ -2894,8 +2901,7 @@ do_standby_switchover(void)
|
|||||||
|
|
||||||
initPQExpBuffer(&command_output);
|
initPQExpBuffer(&command_output);
|
||||||
|
|
||||||
success = remote_command(
|
success = remote_command(host,
|
||||||
host,
|
|
||||||
runtime_options.remote_user,
|
runtime_options.remote_user,
|
||||||
remote_command_str.data,
|
remote_command_str.data,
|
||||||
&command_output);
|
&command_output);
|
||||||
|
|||||||
Reference in New Issue
Block a user