mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 15:46:29 +00:00
"standby register/follow": provide primary node details for event notifications
For events generated by these commands, it may be useful to know details of the primary node. This makes following additional parameters available to event notification scripts: - %p: node ID of the primary - %a: node name of the primary - %c: conninfo string for the primary Implements GitHub #375
This commit is contained in:
@@ -3265,14 +3265,14 @@ _create_event(PGconn *conn, t_configuration_options *options, int node_id, char
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
/* %p: former primary id ("repmgr standby switchover") */
|
||||
/* %p: primary id ("standby_switchover": former primary id) */
|
||||
src_ptr++;
|
||||
if (event_info->former_primary_id != UNKNOWN_NODE_ID)
|
||||
if (event_info->node_id != UNKNOWN_NODE_ID)
|
||||
{
|
||||
PQExpBufferData node_id;
|
||||
initPQExpBuffer(&node_id);
|
||||
appendPQExpBuffer(&node_id,
|
||||
"%i", event_info->former_primary_id);
|
||||
"%i", event_info->node_id);
|
||||
strlcpy(dst_ptr, node_id.data, end_ptr - dst_ptr);
|
||||
dst_ptr += strlen(dst_ptr);
|
||||
termPQExpBuffer(&node_id);
|
||||
|
||||
Reference in New Issue
Block a user