mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-26 08:36:30 +00:00
repmgr node rejoin: handle missing node record correctly
If a connection was provided for a database other than the "repmgr" database, error was logged but execution continued, resulting in the connection being finished twice. Addresses GitHub #358.
This commit is contained in:
@@ -1629,7 +1629,7 @@ do_node_rejoin(void)
|
|||||||
/* check provided upstream connection */
|
/* check provided upstream connection */
|
||||||
upstream_conn = establish_db_connection_by_params(&source_conninfo, true);
|
upstream_conn = establish_db_connection_by_params(&source_conninfo, true);
|
||||||
|
|
||||||
/* sanity-checks for 9.3 */
|
/* sanity checks for 9.3 */
|
||||||
server_version_num = get_server_version(upstream_conn, NULL);
|
server_version_num = get_server_version(upstream_conn, NULL);
|
||||||
|
|
||||||
if (server_version_num < 90400)
|
if (server_version_num < 90400)
|
||||||
@@ -1638,7 +1638,9 @@ do_node_rejoin(void)
|
|||||||
if (get_primary_node_record(upstream_conn, &primary_node_record) == false)
|
if (get_primary_node_record(upstream_conn, &primary_node_record) == false)
|
||||||
{
|
{
|
||||||
log_error(_("unable to retrieve primary node record"));
|
log_error(_("unable to retrieve primary node record"));
|
||||||
|
log_hint(_("check the provided database connection string is for a \"repmgr\" database"));
|
||||||
PQfinish(upstream_conn);
|
PQfinish(upstream_conn);
|
||||||
|
exit(ERR_BAD_CONFIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
PQfinish(upstream_conn);
|
PQfinish(upstream_conn);
|
||||||
|
|||||||
Reference in New Issue
Block a user