2.4.14 Fix xpand cluster setup

This commit is contained in:
Johan Wikman
2020-11-19 13:36:18 +02:00
parent 03e904a33b
commit a0922a2451

View File

@ -133,24 +133,25 @@ int Xpand_nodes::start_replication()
{
int rv = 1;
std::string cluster_setup_sql = std::string("ALTER CLUSTER ADD '")
+ std::string(IP_private[1])
+ std::string("'");
for (int i = 2; i < N; i++)
{
cluster_setup_sql += std::string(",'")
+ std::string(IP_private[i])
+ std::string("'");
}
connect();
execute_query(nodes[0], "%s", cluster_setup_sql.c_str());
// The nodes must be added one by one to the cluster. An attempt to add them
// all with one ALTER command will fail, if one or more of them already are in
// the cluster.
for (int i = 1; i < N; ++i)
{
std::string cluster_setup_sql = std::string("ALTER CLUSTER ADD '")
+ std::string(IP_private[i])
+ std::string("'");
execute_query(nodes[0], "%s", cluster_setup_sql.c_str());
}
close_connections();
rv = 0;
return rv;
}