Update comments in "repmgr master ... " code

This commit is contained in:
Ian Barwick
2017-06-13 09:22:05 +09:00
parent e89c43c5cb
commit 042126dcff

View File

@@ -67,7 +67,7 @@ do_master_register(void)
exit(ERR_BAD_CONFIG); exit(ERR_BAD_CONFIG);
} }
/* Ensure there isn't another active master already registered */ /* Ensure there isn't another registered node which is master */
master_conn = get_master_connection(conn, &current_master_id, NULL); master_conn = get_master_connection(conn, &current_master_id, NULL);
if (master_conn != NULL) if (master_conn != NULL)
@@ -89,17 +89,15 @@ do_master_register(void)
begin_transaction(conn); begin_transaction(conn);
/* /*
* Check if a node with a different ID is registered as master. This shouldn't * Check for an active master node record with a different ID. This shouldn't
* happen but could do if an existing master was shut down without being * happen, but could do if an existing master was shut down without being unregistered.
* unregistered.
*/ */
current_master_id = get_master_node_id(conn); current_master_id = get_master_node_id(conn);
if (current_master_id != NODE_NOT_FOUND && current_master_id != config_file_options.node_id) if (current_master_id != NODE_NOT_FOUND && current_master_id != config_file_options.node_id)
{ {
log_error(_("another node with id %i is already registered as master"), current_master_id); log_error(_("another node with id %i is already registered as master"), current_master_id);
// attempt to connect, add info/hint depending if active... log_detail(_("a streaming replication cluster can have only one master node"));
log_info(_("a streaming replication cluster can have only one master node"));
rollback_transaction(conn); rollback_transaction(conn);
PQfinish(conn); PQfinish(conn);
exit(ERR_BAD_CONFIG); exit(ERR_BAD_CONFIG);
@@ -430,8 +428,6 @@ do_master_unregister(void)
} }
} }
// check if any records point to this record, detail: each, hint: follow or unregister standby(s)
if (runtime_options.dry_run == true) if (runtime_options.dry_run == true)
{ {
log_notice(_("node %s (id: %i) would now be unregistered"), log_notice(_("node %s (id: %i) would now be unregistered"),