standby register: add upstream node ID in event details

This commit is contained in:
Ian Barwick
2019-04-16 10:57:38 +09:00
parent a0c6cb602f
commit ad28cf95bd
2 changed files with 11 additions and 9 deletions

View File

@@ -71,9 +71,9 @@
<programlisting>
$ repmgr -f /etc/repmgr.conf cluster event --event=standby_register
Node ID | Name | Event | OK | Timestamp | Details
---------+-------+------------------+----+---------------------+--------------------------------
3 | node3 | standby_register | t | 2017-08-17 10:28:55 | standby registration succeeded
2 | node2 | standby_register | t | 2017-08-17 10:28:53 | standby registration succeeded</programlisting>
---------+-------+------------------+----+---------------------+-------------------------------------------------------
3 | node3 | standby_register | t | 2019-04-16 10:59:59 | standby registration succeeded; upstream node ID is 1
2 | node2 | standby_register | t | 2019-04-16 10:59:57 | standby registration succeeded; upstream node ID is 1</programlisting>
</para>
</refsect1>
</refentry>

View File

@@ -1725,12 +1725,13 @@ do_standby_register(void)
if (record_created == false)
{
appendPQExpBufferStr(&details,
"standby registration failed");
appendPQExpBuffer(&details,
_("standby registration failed; provided upstream node ID was %i"),
node_record.upstream_node_id);
if (runtime_options.force == true)
appendPQExpBufferStr(&details,
" (-F/--force option was used)");
_(" (-F/--force option was used)"));
create_event_notification_extended(
primary_conn,
@@ -1750,12 +1751,13 @@ do_standby_register(void)
exit(ERR_BAD_CONFIG);
}
appendPQExpBufferStr(&details,
"standby registration succeeded");
appendPQExpBuffer(&details,
_("standby registration succeeded; upstream node ID is %i"),
node_record.upstream_node_id);
if (runtime_options.force == true)
appendPQExpBufferStr(&details,
" (-F/--force option was used)");
_(" (-F/--force option was used)"));
/* Log the event */