From: Date: March 12 2007 3:28pm Subject: bk commit into 5.1 tree (jonas:1.2115) BUG#27003 List-Archive: http://lists.mysql.com/commits/21740 X-Bug: 27003 Message-Id: <20070312142811.7990D711837@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-03-12 15:28:07+01:00, jonas@stripped +5 -0 ndb - bug#27003 Handle random(not in order) LQHKEYREQ failures during node-restart storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-03-12 15:28:05+01:00, jonas@stripped +16 -3 Handle random(not in order) LQHKEYREQ failures during node-restart storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp@stripped, 2007-03-12 15:28:06+01:00, jonas@stripped +24 -0 Error inserts for random TUPKEY errors storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp@stripped, 2007-03-12 15:28:06+01:00, jonas@stripped +1 -1 Move CLEAR_ERROR_INSERT_VALUE to constructor so that it's reasonable to use it for restart testing storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp@stripped, 2007-03-12 15:28:06+01:00, jonas@stripped +1 -0 Add error insert for CopyFragRef storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-03-12 15:28:06+01:00, jonas@stripped +56 -0 Test prg for bug#27003 # 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/drop5 --- 1.92/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-03-12 15:28:11 +01:00 +++ 1.93/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-03-12 15:28:11 +01:00 @@ -9573,6 +9573,15 @@ closeCopyLab(signal); return; }//if + + if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY && + scanptr.p->scanErrorCounter) + { + jam(); + closeCopyLab(signal); + return; + } + if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY) { jam(); /*---------------------------------------------------------------------------*/ @@ -9649,13 +9658,16 @@ void Dblqh::copyLqhKeyRefLab(Signal* signal) { ndbrequire(tcConnectptr.p->transid[1] == signal->theData[4]); - tcConnectptr.p->copyCountWords -= signal->theData[3]; + Uint32 copyWords = signal->theData[3]; scanptr.i = tcConnectptr.p->tcScanRec; c_scanRecordPool.getPtr(scanptr); scanptr.p->scanErrorCounter++; tcConnectptr.p->errorCode = terrorCode; - closeCopyLab(signal); - return; + + LqhKeyConf* conf = (LqhKeyConf*)signal->getDataPtrSend(); + conf->transId1 = copyWords; + conf->transId2 = tcConnectptr.p->transid[1]; + copyCompletedLab(signal); }//Dblqh::copyLqhKeyRefLab() void Dblqh::closeCopyLab(Signal* signal) @@ -9666,6 +9678,7 @@ // Wait until all of those have arrived until we start the // close process. /*---------------------------------------------------------------------------*/ + scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY; jam(); return; }//if --- 1.22/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2007-03-12 15:28:11 +01:00 +++ 1.23/storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp 2007-03-12 15:28:11 +01:00 @@ -213,6 +213,30 @@ //--------------------------------------------------- PagePtr pagePtr; Uint32 pageOffset; + + if (ERROR_INSERTED(4025)) + { + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4026)) + { + CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4027) && (rand() % 100) > 25) + { + signal->theData[0] = 827; + return; + } + if (ERROR_INSERTED(4028) && (rand() % 100) > 25) + { + CLEAR_ERROR_INSERT_VALUE; + signal->theData[0] = 827; + return; + } + if (!allocTh(regFragPtr.p, regTabPtr.p, NORMAL_PAGE, --- 1.25/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-03-12 15:28:11 +01:00 +++ 1.26/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp 2007-03-12 15:28:11 +01:00 @@ -66,6 +66,7 @@ undoPage = 0; totNoOfPagesAllocated = 0; cnoOfAllocatedPages = 0; + CLEAR_ERROR_INSERT_VALUE; // Records with constant sizes }//Dbtup::initData() @@ -576,7 +577,6 @@ switch (startPhase) { case ZSTARTPHASE1: ljam(); - CLEAR_ERROR_INSERT_VALUE; cownref = calcTupBlockRef(0); break; default: --- 1.28/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp 2007-03-12 15:28:11 +01:00 +++ 1.29/storage/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp 2007-03-12 15:28:11 +01:00 @@ -190,6 +190,7 @@ break; case SystemError::CopyFragRefError: + CRASH_INSERTION(1000); BaseString::snprintf(buf, sizeof(buf), "Node %d killed this node because " "it could not copy a fragment during node restart. " --- 1.32/storage/ndb/test/ndbapi/testNodeRestart.cpp 2007-03-12 15:28:11 +01:00 +++ 1.33/storage/ndb/test/ndbapi/testNodeRestart.cpp 2007-03-12 15:28:11 +01:00 @@ -1304,6 +1304,59 @@ return NDBT_OK; } +int +runBug27003(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + NdbRestarter res; + + static const int errnos[] = { 4025, 4026, 4027, 4028, 0 }; + + int node = res.getRandomNotMasterNodeId(rand()); + ndbout_c("node: %d", node); + if (res.restartOneDbNode(node, false, true, true)) + return NDBT_FAILED; + + Uint32 pos = 0; + for (Uint32 i = 0; i