From: Date: June 18 2007 7:49am Subject: bk commit into 5.1 tree (jonas:1.2534) BUG#29167 List-Archive: http://lists.mysql.com/commits/28966 X-Bug: 29167 Message-Id: <20070618054904.BB60E718836@perch.ndb.mysql.com> Below is the list of changes that have just been committed into a local 5.1 repository of jonas. When jonas 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@stripped, 2007-06-18 07:48:59+02:00, jonas@stripped +4 -0 ndb - bug#29167 Fix case where all node in node group dies before they saved sysfile (wrt gcp) and Qmgr incorrectly thinks that "node group is missing" storage/ndb/src/kernel/blocks/ERROR_codes.txt@stripped, 2007-06-18 07:48:55+02:00, jonas@stripped +3 -1 code storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-06-18 07:48:55+02:00, jonas@stripped +13 -0 fix storage/ndb/test/ndbapi/testSystemRestart.cpp@stripped, 2007-06-18 07:48:56+02:00, jonas@stripped +48 -0 test storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-06-18 07:48:56+02:00, jonas@stripped +4 -0 test # 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: jonas # Host: perch.ndb.mysql.com # Root: /home/jonas/src/mysql-5.1-new-ndb --- 1.92/storage/ndb/test/run-test/daily-basic-tests.txt 2007-06-18 07:49:04 +02:00 +++ 1.93/storage/ndb/test/run-test/daily-basic-tests.txt 2007-06-18 07:49:04 +02:00 @@ -485,6 +485,10 @@ cmd: testNodeRestart args: -n Bug27003 T1 +max-time: 300 +cmd: testSystemRestart +args: -n Bug29167 T1 + max-time: 1000 cmd: testNodeRestart args: -n Bug27283 T1 --- 1.39/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2007-06-18 07:49:04 +02:00 +++ 1.40/storage/ndb/src/kernel/blocks/ERROR_codes.txt 2007-06-18 07:49:04 +02:00 @@ -5,7 +5,7 @@ Next DBTUP 4029 Next DBLQH 5045 Next DBDICT 6007 -Next DBDIH 7183 +Next DBDIH 7184 Next DBTC 8040 Next CMVMI 9000 Next BACKUP 10038 @@ -74,6 +74,8 @@ 7177: Delay copying of sysfileData in execCOPY_GCIREQ 7180: Crash master during master-take-over in execMASTER_LCPCONF + +7183: Crash when receiving COPY_GCIREQ ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING: ----------------------------------------------------------------- --- 1.123/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-06-18 07:49:04 +02:00 +++ 1.124/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-06-18 07:49:04 +02:00 @@ -747,6 +747,8 @@ } ndbrequire(ok); + CRASH_INSERTION(7183); + /* ----------------------------------------------------------------------- */ /* WE START BY TRYING TO OPEN THE FIRST RESTORABLE GCI FILE. */ /* ----------------------------------------------------------------------- */ @@ -1230,6 +1232,17 @@ Uint32 ng = Sysfile::getNodeGroup(i, SYSFILE->nodeGroups); ndbrequire(ng < MAX_NDB_NODES); Uint32 gci = node_gcis[i]; + if (gci < SYSFILE->lastCompletedGCI[i]) + { + jam(); + /** + * Handle case, where *I* know that node complete GCI + * but node does not...bug#29167 + * i.e node died before it wrote own sysfile + */ + gci = SYSFILE->lastCompletedGCI[i]; + } + if (gci > node_group_gcis[ng]) { jam(); --- 1.13/storage/ndb/test/ndbapi/testSystemRestart.cpp 2007-06-18 07:49:04 +02:00 +++ 1.14/storage/ndb/test/ndbapi/testSystemRestart.cpp 2007-06-18 07:49:04 +02:00 @@ -1219,6 +1219,48 @@ return result; } +int +runBug29167(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + NdbRestarter restarter; + Ndb* pNdb = GETNDB(step); + const Uint32 nodeCount = restarter.getNumDbNodes(); + + if (nodeCount < 2) + return NDBT_OK; + + int filter[] = { 15, NDB_MGM_EVENT_CATEGORY_CHECKPOINT, 0 }; + NdbLogEventHandle handle = + ndb_mgm_create_logevent_handle(restarter.handle, filter); + + struct ndb_logevent event; + int master = restarter.getMasterNodeId(); + do { + int node1 = restarter.getRandomNodeOtherNodeGroup(master, rand()); + int node2 = restarter.getRandomNodeSameNodeGroup(node1, rand()); + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + restarter.dumpStateAllNodes(val2, 2); + int dump[] = { DumpStateOrd::DihSetTimeBetweenGcp, 30000 }; + restarter.dumpStateAllNodes(dump, 2); + + while(ndb_logevent_get_next(handle, &event, 0) >= 0 && + event.type != NDB_LE_GlobalCheckpointCompleted); + + CHECK(restarter.insertErrorInAllNodes(932) == 0); + + CHECK(restarter.insertErrorInNode(node1, 7183) == 0); + CHECK(restarter.insertErrorInNode(node2, 7183) == 0); + + CHECK(restarter.waitClusterNoStart() == 0); + restarter.startAll(); + CHECK(restarter.waitClusterStarted() == 0); + } while(false); + + return result; +} + NDBT_TESTSUITE(testSystemRestart); TESTCASE("SR1", "Basic system restart test. Focus on testing restart from REDO log.\n" @@ -1399,6 +1441,12 @@ STEP(runBug24664); FINALIZER(runClearTable); } +TESTCASE("Bug29167", "") +{ + INITIALIZER(runWaitStarted); + STEP(runBug29167); +} + NDBT_TESTSUITE_END(testSystemRestart); int main(int argc, const char** argv){