mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
repmgr standby follow: add event details
Useful to have a confirmation of which node was followed.
This commit is contained in:
@@ -1257,6 +1257,7 @@ do_standby_follow(void)
|
|||||||
char restart_command[MAXLEN];
|
char restart_command[MAXLEN];
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
PQExpBufferData event_details;
|
||||||
|
|
||||||
log_verbose(LOG_DEBUG, "do_standby_follow()");
|
log_verbose(LOG_DEBUG, "do_standby_follow()");
|
||||||
|
|
||||||
@@ -1350,7 +1351,6 @@ do_standby_follow(void)
|
|||||||
{
|
{
|
||||||
int server_version_num = get_server_version(primary_conn, NULL);
|
int server_version_num = get_server_version(primary_conn, NULL);
|
||||||
|
|
||||||
PQExpBufferData event_details;
|
|
||||||
initPQExpBuffer(&event_details);
|
initPQExpBuffer(&event_details);
|
||||||
|
|
||||||
if (create_replication_slot(primary_conn, repmgr_slot_name, server_version_num, &event_details) == false)
|
if (create_replication_slot(primary_conn, repmgr_slot_name, server_version_num, &event_details) == false)
|
||||||
@@ -1543,12 +1543,21 @@ do_standby_follow(void)
|
|||||||
|
|
||||||
log_notice(_("STANDBY FOLLOW successful"));
|
log_notice(_("STANDBY FOLLOW successful"));
|
||||||
|
|
||||||
|
initPQExpBuffer(&event_details);
|
||||||
|
appendPQExpBuffer(&event_details,
|
||||||
|
_("node %i is now attached to node %i"),
|
||||||
|
config_file_options.node_id, primary_id);
|
||||||
|
|
||||||
create_event_notification(primary_conn,
|
create_event_notification(primary_conn,
|
||||||
&config_file_options,
|
&config_file_options,
|
||||||
config_file_options.node_id,
|
config_file_options.node_id,
|
||||||
"standby_follow",
|
"standby_follow",
|
||||||
true,
|
true,
|
||||||
NULL);
|
event_details.data);
|
||||||
|
|
||||||
|
log_detail("%s", event_details.data);
|
||||||
|
|
||||||
|
termPQExpBuffer(&event_details);
|
||||||
|
|
||||||
PQfinish(primary_conn);
|
PQfinish(primary_conn);
|
||||||
|
|
||||||
|
|||||||
@@ -721,7 +721,7 @@ monitor_streaming_standby(void)
|
|||||||
upstream_node_status = NODE_STATUS_UNKNOWN;
|
upstream_node_status = NODE_STATUS_UNKNOWN;
|
||||||
|
|
||||||
appendPQExpBuffer(&event_details,
|
appendPQExpBuffer(&event_details,
|
||||||
_("unable to connect to upstream node %s (node ID: %i)"),
|
_("unable to connect to upstream node \"%s\" (node ID: %i)"),
|
||||||
upstream_node_info.node_name, upstream_node_info.node_id);
|
upstream_node_info.node_name, upstream_node_info.node_id);
|
||||||
|
|
||||||
if (upstream_node_info.type == STANDBY)
|
if (upstream_node_info.type == STANDBY)
|
||||||
|
|||||||
Reference in New Issue
Block a user