Skip to content

Commit

Permalink
Prevent rempgrd from looping infinitely if node was not registered
Browse files Browse the repository at this point in the history
  • Loading branch information
ibarwick committed Mar 31, 2015
1 parent 0f86bdc commit 18544c8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions repmgrd.c
Expand Up @@ -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);

/*
Expand Down

0 comments on commit 18544c8

Please sign in to comment.