From: Date: January 4 2007 1:03pm Subject: bk commit into 5.1 tree (tomas:1.2085) BUG#25364 List-Archive: http://lists.mysql.com/commits/17623 X-Bug: 25364 Message-Id: <20070104120330.57BE064251@linux.local> Below is the list of changes that have just been committed into a local 5.1 repository of tomas. When tomas does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet 1.2085 07/01/04 13:03:17 tomas@poseidon. +6 -0 ndb - bug#25364 on master node failure during qmgr-commitreq make sure to remove all committed failed nodes from failed/prepfailed arrays storage/ndb/test/run-test/daily-basic-tests.txt 1.39 07/01/04 13:03:10 tomas@poseidon. +4 -0 testcase storage/ndb/test/ndbapi/testNodeRestart.cpp 1.26 07/01/04 13:03:10 tomas@poseidon. +43 -0 testcase storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 1.33 07/01/04 13:03:10 tomas@poseidon. +59 -13 make sure to remove all committed failed nodes from failed/prepfailed arrays storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 1.14 07/01/04 13:03:10 tomas@poseidon. +4 -0 extra error insert variable storage/ndb/src/kernel/blocks/ERROR_codes.txt 1.19 07/01/04 13:03:10 tomas@poseidon. +3 -0 new error code storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 1.9 07/01/04 13:03:10 tomas@poseidon. +1 -0 new error code # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: tomas # Host: poseidon. # Root: /home/tomas/mysql-5.1-wl2325-5.0 --- 1.38/storage/ndb/test/run-test/daily-basic-tests.txt 2007-01-04 12:15:38 +01:00 +++ 1.39/storage/ndb/test/run-test/daily-basic-tests.txt 2007-01-04 13:03:10 +01:00 @@ -449,6 +449,10 @@ cmd: testNodeRestart args: -n Bug24543 T1 +max-time: 1000 +cmd: testNodeRestart +args: -n Bug25364 T1 + # OLD FLEX max-time: 500 cmd: flexBench --- 1.8/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2006-04-05 16:05:35 +02:00 +++ 1.9/storage/ndb/include/kernel/signaldata/DumpStateOrd.hpp 2007-01-04 13:03:10 +01:00 @@ -68,6 +68,7 @@ // 100-105 TUP and ACC // 200-240 UTIL // 300-305 TRIX + QmgrErr935 = 935, NdbfsDumpFileStat = 400, NdbfsDumpAllFiles = 401, NdbfsDumpOpenFiles = 402, --- 1.18/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2007-01-04 12:15:38 +01:00 +++ 1.19/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2007-01-04 13:03:10 +01:00 @@ -24,6 +24,9 @@ 934 : Crash president in ALLOC_NODE_ID_REQ +935 : Crash master on node failure (delayed) + and skip sending GSN_COMMIT_FAILREQ to specified node + ERROR CODES FOR TESTING NODE FAILURE, GLOBAL CHECKPOINT HANDLING: ----------------------------------------------------------------- --- 1.13/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2006-12-20 13:54:43 +01:00 +++ 1.14/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2007-01-04 13:03:10 +01:00 @@ -451,6 +451,10 @@ void recompute_version_info(Uint32 type, Uint32 version); void execNODE_VERSION_REP(Signal* signal); void sendApiVersionRep(Signal* signal, NodeRecPtr nodePtr); + +#ifdef ERROR_INSERT + Uint32 c_error_insert_extra; +#endif }; #endif --- 1.32/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2006-12-20 13:54:43 +01:00 +++ 1.33/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2007-01-04 13:03:10 +01:00 @@ -3242,6 +3242,18 @@ for (nodePtr.i = 1; nodePtr.i < MAX_NDB_NODES; nodePtr.i++) { jam(); ptrAss(nodePtr, nodeRec); + +#ifdef ERROR_INSERT + if (ERROR_INSERTED(935) && nodePtr.i == c_error_insert_extra) + { + ndbout_c("skipping node %d", c_error_insert_extra); + CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = 9999; + sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 1000, 1); + continue; + } +#endif + if (nodePtr.p->phase == ZRUNNING) { jam(); nodePtr.p->sendCommitFailReqStatus = Q_ACTIVE; @@ -3312,6 +3324,33 @@ return; }//Qmgr::execPREP_FAILREF() +static +Uint32 +clear_nodes(Uint32 dstcnt, Uint16 dst[], Uint32 srccnt, const Uint16 src[]) +{ + if (srccnt == 0) + return dstcnt; + + Uint32 pos = 0; + for (Uint32 i = 0; i 0) { - jam(); - guard0 = cnoFailedNodes - 1; - arrGuard(guard0 + cnoCommitFailedNodes, MAX_NDB_NODES); - for (Tj = 0; Tj <= guard0; Tj++) { - jam(); - cfailedNodes[Tj] = cfailedNodes[Tj + cnoCommitFailedNodes]; - }//for - }//if - }//if + + /** + * Remove committed nodes from failed/prepared + */ + cnoFailedNodes = clear_nodes(cnoFailedNodes, + cfailedNodes, + cnoCommitFailedNodes, + ccommitFailedNodes); + cnoPrepFailedNodes = clear_nodes(cnoPrepFailedNodes, + cprepFailedNodes, + cnoCommitFailedNodes, + ccommitFailedNodes); cnoCommitFailedNodes = 0; }//if /**----------------------------------------------------------------------- @@ -4790,6 +4828,14 @@ default: ; }//switch + +#ifdef ERROR_INSERT + if (signal->theData[0] == 935 && signal->getLength() == 2) + { + SET_ERROR_INSERT_VALUE(935); + c_error_insert_extra = signal->theData[1]; + } +#endif }//Qmgr::execDUMP_STATE_ORD() void Qmgr::execSET_VAR_REQ(Signal* signal) --- 1.25/storage/ndb/test/ndbapi/testNodeRestart.cpp 2006-11-23 14:39:10 +01:00 +++ 1.26/storage/ndb/test/ndbapi/testNodeRestart.cpp 2007-01-04 13:03:10 +01:00 @@ -949,6 +949,46 @@ return NDBT_OK; } +int runBug25364(NDBT_Context* ctx, NDBT_Step* step){ + int result = NDBT_OK; + NdbRestarter restarter; + Ndb* pNdb = GETNDB(step); + int loops = ctx->getNumLoops(); + + if (restarter.getNumDbNodes() < 4) + return NDBT_OK; + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + + for (; loops; loops --) + { + int master = restarter.getMasterNodeId(); + int victim = restarter.getRandomNodeOtherNodeGroup(master, rand()); + int second = restarter.getRandomNodeSameNodeGroup(victim, rand()); + + int dump[] = { 935, victim } ; + if (restarter.dumpStateOneNode(master, dump, 2)) + return NDBT_FAILED; + + if (restarter.dumpStateOneNode(master, val2, 2)) + return NDBT_FAILED; + + if (restarter.restartOneDbNode(second, false, true, true)) + return NDBT_FAILED; + + int nodes[2] = { master, second }; + 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", @@ -1265,6 +1305,9 @@ TESTCASE("Bug24543", "") { INITIALIZER(runBug24543); +} +TESTCASE("Bug25364", ""){ + INITIALIZER(runBug25364); } NDBT_TESTSUITE_END(testNodeRestart);