From: Date: June 4 2008 3:57pm Subject: bzr commit into mysql-5.1-telco-6.4 tree (frazer:2631) Bug#37158 List-Archive: http://lists.mysql.com/commits/47437 X-Bug: 37158 Message-Id: <200806041357.m54DvXi6010939@forth.ndb.mysql.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0688929722==" --===============0688929722== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/frazer/bzr/mysql-5.1-telco-6.4/ ------------------------------------------------------------ revno: 2631 revision-id: frazer@stripped parent: frazer@stripped parent: jonas@stripped committer: Frazer Clement branch nick: mysql-5.1-telco-6.4 timestamp: Wed 2008-06-04 14:57:16 +0100 message: Merge modified: storage/ndb/src/ndbapi/NdbTransaction.cpp sp1f-ndbconnection.cpp-20040414082424-ftc4cxrlno6yr3fmp3xzpp66xyx2x3kd storage/ndb/src/ndbapi/TransporterFacade.cpp sp1f-transporterfacade.cp-20040414082425-7g53fpp472t6eqf5c2az33qijwsnwr5r storage/ndb/test/ndbapi/testDict.cpp sp1f-testdict.cpp-20040414082437-up57fojv5zipbzkv3mijrxhignscrlpl storage/ndb/test/ndbapi/testNdbApi.cpp sp1f-testndbapi.cpp-20040414082437-mjif6fqfd5ohitwss3gjohzfn6pzn3sg storage/ndb/test/run-test/daily-basic-tests.txt sp1f-dailybasictests.txt-20040623115449-liur6p3tedydxdte6rr35pqap26frov6 ------------------------------------------------------------ revno: 2629.1.2 revision-id: jonas@stripped parent: jonas@stripped committer: jonas@stripped branch nick: telco-6.4 timestamp: Wed 2008-06-04 13:36:09 +0200 message: ndb - add missing test prg (FailCreateHashmap) that got lost in bzr merge confusion modified: storage/ndb/test/ndbapi/testDict.cpp sp1f-testdict.cpp-20040414082437-up57fojv5zipbzkv3mijrxhignscrlpl ------------------------------------------------------------ revno: 2629.1.1 revision-id: jonas@stripped parent: monty@stripped parent: jonas@stripped committer: jonas@stripped branch nick: telco-6.4 timestamp: Tue 2008-06-03 18:28:09 +0200 message: merge modified: storage/ndb/src/ndbapi/NdbTransaction.cpp sp1f-ndbconnection.cpp-20040414082424-ftc4cxrlno6yr3fmp3xzpp66xyx2x3kd storage/ndb/src/ndbapi/TransporterFacade.cpp sp1f-transporterfacade.cp-20040414082425-7g53fpp472t6eqf5c2az33qijwsnwr5r storage/ndb/test/ndbapi/testNdbApi.cpp sp1f-testndbapi.cpp-20040414082437-mjif6fqfd5ohitwss3gjohzfn6pzn3sg storage/ndb/test/run-test/daily-basic-tests.txt sp1f-dailybasictests.txt-20040623115449-liur6p3tedydxdte6rr35pqap26frov6 ------------------------------------------------------------ revno: 2585.4.1 revision-id: jonas@stripped parent: monty@stripped parent: jonas@stripped committer: jonas@stripped branch nick: telco-6.3 timestamp: Tue 2008-06-03 18:18:01 +0200 message: merge modified: storage/ndb/src/ndbapi/NdbTransaction.cpp sp1f-ndbconnection.cpp-20040414082424-ftc4cxrlno6yr3fmp3xzpp66xyx2x3kd storage/ndb/test/ndbapi/testNdbApi.cpp sp1f-testndbapi.cpp-20040414082437-mjif6fqfd5ohitwss3gjohzfn6pzn3sg storage/ndb/test/run-test/daily-basic-tests.txt sp1f-dailybasictests.txt-20040623115449-liur6p3tedydxdte6rr35pqap26frov6 ------------------------------------------------------------ revno: 2572.18.1 revision-id: jonas@stripped parent: monty@stripped committer: jonas@stripped branch nick: telco-6.2 timestamp: Tue 2008-06-03 14:37:17 +0200 message: ndb - bug#37158 ndbapi could get confused if tckeyref/tckeyconf came in not common order modified: storage/ndb/src/ndbapi/NdbTransaction.cpp sp1f-ndbconnection.cpp-20040414082424-ftc4cxrlno6yr3fmp3xzpp66xyx2x3kd storage/ndb/test/ndbapi/testNdbApi.cpp sp1f-testndbapi.cpp-20040414082437-mjif6fqfd5ohitwss3gjohzfn6pzn3sg storage/ndb/test/run-test/daily-basic-tests.txt sp1f-dailybasictests.txt-20040623115449-liur6p3tedydxdte6rr35pqap26frov6 --===============0688929722== MIME-Version: 1.0 Content-Type: text/text/x-diff; charset="us-ascii"; name="patch-2631.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline === modified file 'storage/ndb/src/ndbapi/NdbTransaction.cpp' --- a/storage/ndb/src/ndbapi/NdbTransaction.cpp 2008-05-21 16:43:13 +0000 +++ b/storage/ndb/src/ndbapi/NdbTransaction.cpp 2008-06-03 16:18:01 +0000 @@ -1926,28 +1926,24 @@ tGCI_lo = 0; } Uint64 tGCI = Uint64(tGCI_lo) | (Uint64(tGCI_hi) << 32); - if (tCommitFlag == 1) { + if (tCommitFlag == 1) + { theCommitStatus = Committed; theGlobalCheckpointId = tGCI; if (tGCI) // Read(dirty) only transaction doesnt get GCI { *p_latest_trans_gci = tGCI; } - } else if ((tNoComp >= tNoSent) && - (theLastExecOpInList->theCommitIndicator == 1)){ - - -/**********************************************************************/ -// We sent the transaction with Commit flag set and received a CONF with -// no Commit flag set. This is clearly an anomaly. -/**********************************************************************/ - theError.code = 4011; - theCompletionStatus = CompletedFailure; - theReturnStatus = NdbTransaction::ReturnFailure; - theCommitStatus = Aborted; - return 0; + } + else if (theLastExecOpInList->theCommitIndicator == 1) + { + /** + * We're waiting for a commit reply... + */ + return -1; }//if - if (tNoComp >= tNoSent) { + if (tNoComp >= tNoSent) + { return 0; // No more operations to wait for }//if // Not completed the reception yet. @@ -2107,27 +2103,25 @@ Uint64 tGCI = Uint64(tGCI_lo) | (Uint64(tGCI_hi) << 32); theNoOfOpCompleted = tNoComp; - if (tCommitFlag == 1) { + if (tCommitFlag == 1) + { theCommitStatus = Committed; theGlobalCheckpointId = tGCI; if (tGCI) // Read(dirty) only transaction doesnt get GCI { *p_latest_trans_gci = tGCI; } - } else if ((tNoComp >= tNoSent) && - (theLastExecOpInList->theCommitIndicator == 1)){ + } + else if (theLastExecOpInList->theCommitIndicator == 1) + { + /** + * We're waiting for a commit reply... + */ + return -1; + }//if - /**********************************************************************/ - // We sent the transaction with Commit flag set and received a CONF with - // no Commit flag set. This is clearly an anomaly. - /**********************************************************************/ - theError.code = 4011; - theCompletionStatus = NdbTransaction::CompletedFailure; - theCommitStatus = NdbTransaction::Aborted; - theReturnStatus = NdbTransaction::ReturnFailure; - return 0; - }//if - if (tNoComp >= tNoSent) { + if (tNoComp >= tNoSent) + { return 0; // No more operations to wait for }//if // Not completed the reception yet. === modified file 'storage/ndb/src/ndbapi/TransporterFacade.cpp' --- a/storage/ndb/src/ndbapi/TransporterFacade.cpp 2008-05-29 15:06:11 +0000 +++ b/storage/ndb/src/ndbapi/TransporterFacade.cpp 2008-06-03 16:28:09 +0000 @@ -205,10 +205,10 @@ case GSN_API_REGCONF: return false; #endif -#if 0 +#if 1 case GSN_SUB_GCP_COMPLETE_REP: case GSN_SUB_GCP_COMPLETE_ACK: - return true; + return false; #endif default: return true; === modified file 'storage/ndb/test/ndbapi/testDict.cpp' --- a/storage/ndb/test/ndbapi/testDict.cpp 2008-05-31 06:36:34 +0000 +++ b/storage/ndb/test/ndbapi/testDict.cpp 2008-06-04 11:36:09 +0000 @@ -6034,6 +6034,67 @@ } // end schema trans + +int +runFailCreateHashmap(NDBT_Context* ctx, NDBT_Step* step) +{ + static int lst[] = { 6204, 6205, 6206, 6207, 6208, 6209, 6210, 6211, 0 }; + + NdbRestarter restarter; + int nodeId = restarter.getMasterNodeId(); + Ndb* pNdb = GETNDB(step); + NdbDictionary::Dictionary* pDic = pNdb->getDictionary(); + + int errNo = 0; + char buf[100]; + if (NdbEnv_GetEnv("ERRNO", buf, sizeof(buf))) + { + errNo = atoi(buf); + ndbout_c("Using errno: %u", errNo); + } + + const int loops = ctx->getNumLoops(); + int result = NDBT_OK; + + int dump1 = DumpStateOrd::SchemaResourceSnapshot; + int dump2 = DumpStateOrd::SchemaResourceCheckLeak; + + NdbDictionary::HashMap hm; + pDic->initDefaultHashMap(hm, 1); + +loop: + if (pDic->getHashMap(hm, hm.getName()) != -1) + { + pDic->initDefaultHashMap(hm, rand() % 64); + goto loop; + } + + for (int l = 0; l < loops; l++) + { + for (unsigned i0 = 0; lst[i0]; i0++) + { + unsigned j = (l == 0 ? i0 : myRandom48(i0 + l)); + int errval = lst[j]; + if (errNo != 0 && errNo != errval) + continue; + g_info << "insert error node=" << nodeId << " value=" << errval << endl; + CHECK2(restarter.insertErrorInNode(nodeId, errval) == 0, + "failed to set error insert"); + CHECK(restarter.dumpStateAllNodes(&dump1, 1) == 0); + + int res = pDic->createHashMap(hm); + CHECK2(res != 0, "create hashmap failed to fail"); + + NdbDictionary::HashMap check; + CHECK2(res != 0, "create hashmap existed"); + + CHECK(restarter.dumpStateAllNodes(&dump2, 1) == 0); + } + } +end: + return result; +} +// end FAIL create hashmap NDBT_TESTSUITE(testDict); TESTCASE("testDropDDObjects", @@ -6240,6 +6301,11 @@ ""){ INITIALIZER(runBug29186); } +TESTCASE("FailCreateHashmap", + "Fail create hashmap") +{ + INITIALIZER(runFailCreateHashmap); +} NDBT_TESTSUITE_END(testDict); int main(int argc, const char** argv){ === modified file 'storage/ndb/test/ndbapi/testNdbApi.cpp' --- a/storage/ndb/test/ndbapi/testNdbApi.cpp 2007-07-02 17:08:02 +0000 +++ b/storage/ndb/test/ndbapi/testNdbApi.cpp 2008-06-03 12:37:17 +0000 @@ -1674,6 +1674,60 @@ return result; } +int +runBug37158(NDBT_Context* ctx, NDBT_Step* step) +{ + int result = NDBT_OK; + Ndb* pNdb = GETNDB(step); + + for (Uint32 i = 0; igetNumLoops(); i++) + { + HugoOperations hugoOps(*ctx->getTab()); + hugoOps.startTransaction(pNdb); + if (hugoOps.pkWriteRecord(pNdb, 0) != 0) + { + result = NDBT_FAILED; + goto done; + } + + + if (hugoOps.pkWritePartialRecord(pNdb, 1) != 0) + { + result = NDBT_FAILED; + goto done; + } + + if (hugoOps.pkWriteRecord(pNdb, 2) != 0) + { + result = NDBT_FAILED; + goto done; + } + + if (hugoOps.pkUpdateRecord(pNdb, 0) != 0) + { + result = NDBT_FAILED; + goto done; + } + + if (hugoOps.execute_Commit(pNdb, AO_IgnoreError) == 4011) + { + result = NDBT_FAILED; + goto done; + } + hugoOps.closeTransaction(pNdb); + + if (runClearTable(ctx, step) != 0) + { + result = NDBT_FAILED; + goto done; + } + } + +done: + + return result; +} + NDBT_TESTSUITE(testNdbApi); TESTCASE("MaxNdb", "Create Ndb objects until no more can be created\n"){ @@ -1782,6 +1836,10 @@ ""){ INITIALIZER(runBug28443); } +TESTCASE("Bug37158", + ""){ + INITIALIZER(runBug37158); +} NDBT_TESTSUITE_END(testNdbApi); int main(int argc, const char** argv){ === modified file 'storage/ndb/test/run-test/daily-basic-tests.txt' --- a/storage/ndb/test/run-test/daily-basic-tests.txt 2008-06-02 13:27:27 +0000 +++ b/storage/ndb/test/run-test/daily-basic-tests.txt 2008-06-03 16:28:09 +0000 @@ -1157,4 +1157,10 @@ args: -l 1 -n FailCreateHashmap T1 # EOF 2008-05-30 +# 2008-06-03 +max-time: 1200 +cmd: testNdbApi +args: -l 100 -n Bug37158 + +# EOF 2008-06-03 # EOF --===============0688929722==--