Commit c08aca36 authored by unknown's avatar unknown

Bug#23546, Cluster configured without any arbitration


storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  add a judgement for arbitration rank configuration, if neither MGMD nor API nodes
  are configured with rank = 0, show warning information;
  correct indentations around patch;
parent b391a522
...@@ -3604,6 +3604,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3604,6 +3604,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 db_nodes= 0; Uint32 db_nodes= 0;
Uint32 replicas= 0; Uint32 replicas= 0;
Uint32 db_host_count= 0; Uint32 db_host_count= 0;
bool with_arbitration_rank= false;
ctx.m_userProperties.get(DB_TOKEN, &db_nodes); ctx.m_userProperties.get(DB_TOKEN, &db_nodes);
ctx.m_userProperties.get("NoOfReplicas", &replicas); ctx.m_userProperties.get("NoOfReplicas", &replicas);
if((db_nodes % replicas) != 0){ if((db_nodes % replicas) != 0){
...@@ -3670,7 +3671,6 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3670,7 +3671,6 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
node_group_warning.appfmt(" Node group %d", group); node_group_warning.appfmt(" Node group %d", group);
c|= 1 << j; c|= 1 << j;
p_db_hosts.put(str.c_str(),c); p_db_hosts.put(str.c_str(),c);
node_group_warning.appfmt(",\n db node with id %d and id %d " node_group_warning.appfmt(",\n db node with id %d and id %d "
"on same host %s", other_i, i, host); "on same host %s", other_i, i, host);
} }
...@@ -3698,6 +3698,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3698,6 +3698,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
Uint32 rank; Uint32 rank;
if(tmp->get("ArbitrationRank", &rank) && rank > 0) if(tmp->get("ArbitrationRank", &rank) && rank > 0)
{ {
with_arbitration_rank = true; //check whether MGM or API node configured with rank >0
if(host && host[0] != 0) if(host && host[0] != 0)
{ {
Uint32 ii; Uint32 ii;
...@@ -3716,6 +3717,13 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections, ...@@ -3716,6 +3717,13 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>&sections,
} }
if (db_host_count > 1 && node_group_warning.length() > 0) if (db_host_count > 1 && node_group_warning.length() > 0)
ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str()); ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str());
if (!with_arbitration_rank)
{
ndbout_c("Cluster configuration warning:"
"\n Neither %s nor %s nodes are configured with arbitrator,"
"\n may cause complete cluster shutdown in case of host failure.",
MGM_TOKEN, API_TOKEN);
}
if (db_host_count > 1 && arbitration_warning.length() > 0) if (db_host_count > 1 && arbitration_warning.length() > 0)
ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(), ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
"\n Running arbitrator on the same host as a database node may" "\n Running arbitrator on the same host as a database node may"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment