mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 15:24:16 +01:00
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;
This commit is contained in:
parent
b391a52284
commit
c08aca36a0
1 changed files with 78 additions and 70 deletions
|
@ -3604,6 +3604,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
|
|||
Uint32 db_nodes= 0;
|
||||
Uint32 replicas= 0;
|
||||
Uint32 db_host_count= 0;
|
||||
bool with_arbitration_rank= false;
|
||||
ctx.m_userProperties.get(DB_TOKEN, &db_nodes);
|
||||
ctx.m_userProperties.get("NoOfReplicas", &replicas);
|
||||
if((db_nodes % replicas) != 0){
|
||||
|
@ -3670,7 +3671,6 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
|
|||
node_group_warning.appfmt(" Node group %d", group);
|
||||
c|= 1 << j;
|
||||
p_db_hosts.put(str.c_str(),c);
|
||||
|
||||
node_group_warning.appfmt(",\n db node with id %d and id %d "
|
||||
"on same host %s", other_i, i, host);
|
||||
}
|
||||
|
@ -3698,6 +3698,7 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
|
|||
Uint32 rank;
|
||||
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)
|
||||
{
|
||||
Uint32 ii;
|
||||
|
@ -3716,6 +3717,13 @@ check_node_vs_replicas(Vector<ConfigInfo::ConfigRuleSection>§ions,
|
|||
}
|
||||
if (db_host_count > 1 && node_group_warning.length() > 0)
|
||||
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)
|
||||
ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
|
||||
"\n Running arbitrator on the same host as a database node may"
|
||||
|
|
Loading…
Add table
Reference in a new issue