Commit 94069b1d authored by unknown's avatar unknown

ndb - bug#24543

  Resend if master dies during alloc node id


storage/ndb/src/kernel/blocks/ERROR_codes.txt:
  Add new error code
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Add new error code
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  Make sure to resend if master died
storage/ndb/test/ndbapi/testNodeRestart.cpp:
  add testcase
storage/ndb/test/run-test/daily-basic-tests.txt:
  add testcase
parent 9f8d2e5b
......@@ -21,6 +21,9 @@ Crash president when he starts to run in ArbitState 1-9.
910: Crash new president after node crash
934 : Crash president in ALLOC_NODE_ID_REQ
ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING:
-----------------------------------------------------------------
......
......@@ -4832,6 +4832,11 @@ Qmgr::execALLOC_NODEID_REQ(Signal * signal)
return;
}
if (ERROR_INSERTED(934) && nodeId != getOwnNodeId())
{
CRASH_INSERTION(934);
}
opAllocNodeIdReq.m_req = *req;
opAllocNodeIdReq.m_error = 0;
opAllocNodeIdReq.m_connectCount = getNodeInfo(refToNode(senderRef)).m_connectCount;
......
......@@ -2051,7 +2051,10 @@ MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
ndbout_c("Node %d fail completed", rep->failedNodeId);
#endif
if (rep->failedNodeId == nodeId)
{
do_send = 1;
nodeId = 0;
}
continue;
}
case GSN_NODE_FAILREP:{
......
......@@ -966,6 +966,37 @@ runBug21271(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
int
runBug24543(NDBT_Context* ctx, NDBT_Step* step){
NdbRestarter restarter;
int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
if (restarter.dumpStateAllNodes(val2, 2))
return NDBT_FAILED;
int nodes[2];
nodes[0] = restarter.getMasterNodeId();
restarter.insertErrorInNode(nodes[0], 934);
nodes[1] = restarter.getRandomNodeOtherNodeGroup(nodes[0], rand());
if (nodes[1] == -1)
{
nodes[1] = restarter.getRandomNodeSameNodeGroup(nodes[0], rand());
}
restarter.restartOneDbNode(nodes[1], false, true, true);
if (restarter.waitNodesNoStart(nodes, 2))
return NDBT_FAILED;
restarter.startNodes(nodes, 2);
if (restarter.waitNodesStarted(nodes, 2))
{
return NDBT_FAILED;
}
return NDBT_OK;
}
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
......@@ -1279,6 +1310,10 @@ TESTCASE("Bug20185",
STEP(runBug20185);
FINALIZER(runClearTable);
}
TESTCASE("Bug24543", "")
{
INITIALIZER(runBug24543);
}
TESTCASE("Bug21271",
""){
INITIALIZER(runLoadTable);
......
......@@ -744,6 +744,10 @@ max-time: 1000
cmd: testSRBank
args: -n Mix -l 300 -r 15 T1
max-time: 300
cmd: testNodeRestart
args: -n Bug24543 T1
# OLD FLEX
max-time: 500
cmd: flexBench
......
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