From: Date: October 28 2008 11:58am Subject: bzr commit into mysql-5.1 branch (jonas:2722) Bug#40370 List-Archive: http://lists.mysql.com/commits/57186 X-Bug: 40370 Message-Id: <20081028105808.85675942E6F@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit #At file:///home/jonas/src/telco-6.3/ 2722 Jonas Oreland 2008-10-28 ndb - bug#40370 - master node can die during node-restart - fix incorrect assertion - improve testNodeRestart -n pnr to restart half cluster instead of just 2 nodes at a time modified: storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp storage/ndb/test/ndbapi/testNodeRestart.cpp === modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2008-09-12 07:21:54 +0000 +++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2008-10-28 10:57:58 +0000 @@ -8870,25 +8870,27 @@ void Dbdih::copyGciLab(Signal* signal, C { if(c_copyGCIMaster.m_copyReason != CopyGCIReq::IDLE) { + jam(); /** * There can currently only be two waiting */ for (Uint32 i = 0; i res) + { + res = arr[i]; + } + } + return res; +} + +int runPnr(NDBT_Context* ctx, NDBT_Step* step) { int loops = ctx->getNumLoops(); NdbRestarter res; bool lcp = ctx->getProperty("LCP", (unsigned)0); - if (res.getNumDbNodes() < 4) + int nodegroups[MAX_NDB_NODES]; + bzero(nodegroups, sizeof(nodegroups)); + + for (int i = 0; istopTest(); - return NDBT_OK; + int node = res.getDbNodeId(i); + nodegroups[res.getNodeGroup(node)]++; } + for (int i = 0; istopTest(); + return NDBT_OK; + } + } + for (int i = 0; iisTestStopped() == false; i++) { if (lcp) @@ -2113,24 +2143,40 @@ runPnr(NDBT_Context* ctx, NDBT_Step* ste res.dumpStateAllNodes(&lcpdump, 1); } - int nodes[2]; - nodes[0] = res.getNode(NdbRestarter::NS_RANDOM); - nodes[1] = res.getRandomNodeOtherNodeGroup(nodes[0], rand()); + int ng_copy[MAX_NDB_NODES]; + memcpy(ng_copy, nodegroups, sizeof(ng_copy)); - ndbout_c("restarting %u %u", nodes[0], nodes[1]); + Vector nodes; + printf("restarting "); + while (max_cnt(ng_copy, MAX_NDB_NODES) > 1) + { + int node = res.getNode(NdbRestarter::NS_RANDOM); + int ng = res.getNodeGroup(node); + if (ng_copy[ng] > 1) + { + printf("%u ", node); + nodes.push_back(node); + ng_copy[ng]--; + } + } + printf("\n"); int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; - res.dumpStateOneNode(nodes[0], val2, 2); - res.dumpStateOneNode(nodes[1], val2, 2); + for (Uint32 j = 0; j