mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
@@ -318,7 +318,7 @@ getMasterConnection(PGconn *standby_conn, char *schema, int id, char *cluster,
|
|||||||
log_info(_("finding node list for cluster '%s'\n"),
|
log_info(_("finding node list for cluster '%s'\n"),
|
||||||
cluster);
|
cluster);
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery, "SELECT * FROM %s.repl_nodes "
|
sqlquery_snprintf(sqlquery, "SELECT id, conninfo FROM %s.repl_nodes "
|
||||||
" WHERE cluster = '%s' and id <> %d and not witness",
|
" WHERE cluster = '%s' and id <> %d and not witness",
|
||||||
schema_quoted, cluster, id);
|
schema_quoted, cluster, id);
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ getMasterConnection(PGconn *standby_conn, char *schema, int id, char *cluster,
|
|||||||
{
|
{
|
||||||
/* initialize with the values of the current node being processed */
|
/* initialize with the values of the current node being processed */
|
||||||
*master_id = atoi(PQgetvalue(res1, i, 0));
|
*master_id = atoi(PQgetvalue(res1, i, 0));
|
||||||
strncpy(master_conninfo, PQgetvalue(res1, i, 2), MAXCONNINFO);
|
strncpy(master_conninfo, PQgetvalue(res1, i, 1), MAXCONNINFO);
|
||||||
log_info(_("checking role of cluster node '%s'\n"),
|
log_info(_("checking role of cluster node '%s'\n"),
|
||||||
master_conninfo);
|
master_conninfo);
|
||||||
master_conn = establishDBConnection(master_conninfo, false);
|
master_conn = establishDBConnection(master_conninfo, false);
|
||||||
|
|||||||
10
repmgr.c
10
repmgr.c
@@ -519,7 +519,7 @@ do_master_register(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes (id, cluster, name, conninfo, priority) "
|
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes (id, cluster, name, conninfo, priority) "
|
||||||
"VALUES (%d, '%s', '%s', %d)",
|
"VALUES (%d, '%s', '%s', '%s', %d)",
|
||||||
repmgr_schema, options.node, options.cluster_name, options.node_name,
|
repmgr_schema, options.node, options.cluster_name, options.node_name,
|
||||||
options.conninfo, options.priority);
|
options.conninfo, options.priority);
|
||||||
log_debug(_("master register: %s\n"), sqlquery);
|
log_debug(_("master register: %s\n"), sqlquery);
|
||||||
@@ -662,7 +662,7 @@ do_standby_register(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes(id, cluster, name, conninfo, priority) "
|
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes(id, cluster, name, conninfo, priority) "
|
||||||
"VALUES (%d, '%s', '%s', %d)",
|
"VALUES (%d, '%s', '%s', '%s', %d)",
|
||||||
repmgr_schema, options.node, options.cluster_name, options.node_name,
|
repmgr_schema, options.node, options.cluster_name, options.node_name,
|
||||||
options.conninfo, options.priority);
|
options.conninfo, options.priority);
|
||||||
log_debug(_("standby register: %s\n"), sqlquery);
|
log_debug(_("standby register: %s\n"), sqlquery);
|
||||||
@@ -1516,9 +1516,9 @@ do_witness_create(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* register ourselves in the master */
|
/* register ourselves in the master */
|
||||||
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes(id, cluster, conninfo, priority, witness) "
|
sqlquery_snprintf(sqlquery, "INSERT INTO %s.repl_nodes(id, cluster, name, conninfo, priority, witness) "
|
||||||
"VALUES (%d, '%s', '%s', %d, true)",
|
"VALUES (%d, '%s', '%s', '%s', %d, true)",
|
||||||
repmgr_schema, options.node, options.cluster_name, options.conninfo);
|
repmgr_schema, options.node, options.cluster_name, options.node_name, options.conninfo);
|
||||||
|
|
||||||
log_debug(_("witness create: %s"), sqlquery);
|
log_debug(_("witness create: %s"), sqlquery);
|
||||||
if (!PQexec(masterconn, sqlquery))
|
if (!PQexec(masterconn, sqlquery))
|
||||||
|
|||||||
Reference in New Issue
Block a user