Prevent rempgrd from looping infinitely if node was not registered

This commit is contained in:
Ian Barwick
2015-03-31 14:25:08 +09:00
parent 0f86bdcd05
commit 18544c82ca

View File

@@ -287,6 +287,14 @@ main(int argc, char **argv)
/* Retrieve record for this node from the local database */
node_info = get_node_info(my_local_conn, local_options.cluster_name, local_options.node);
/* No node record found - exit gracefully */
if(node_info.node_id == -1)
{
log_err(_("No metadata record found for this node - terminating\n"));
log_notice(_("HINT: was this node registered with 'repmgr (master|standby) register'?\n"));
terminate(ERR_BAD_CONFIG);
}
log_debug("node id is %i, upstream is %i\n", node_info.node_id, node_info.upstream_node_id);
/*