From: Date: October 15 2007 9:10am Subject: bk commit into 5.1 tree (jonas:1.2574) BUG#31482 List-Archive: http://lists.mysql.com/commits/35543 X-Bug: 31482 Message-Id: <20071015071021.3AD3778431A@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-10-15 09:10:14+02:00, jonas@stripped +17 -0 ndb - bug#31482 (re)impl. simple-read (read that releases lock just before LQHKEYCONF) use simple-read for blobs storage/ndb/include/kernel/signaldata/TcKeyConf.hpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +1 -1 rename bit storage/ndb/include/ndbapi/NdbOperation.hpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +2 -1 add new lock-mode storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +2 -2 rename bit storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +0 -1 remove aggregate storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +48 -28 impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +4 -8 impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +107 -92 impl. simple-read = normal read + release lock just before LQHKEYCONF storage/ndb/src/ndbapi/NdbBlob.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +1 -1 use simple read for blobs storage/ndb/src/ndbapi/NdbIndexOperation.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +3 -0 no simple-read for ui (yet) storage/ndb/src/ndbapi/NdbOperationDefine.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +33 -29 impl. simple-read storage/ndb/src/ndbapi/NdbOperationExec.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +8 -9 impl. simple-read storage/ndb/src/ndbapi/NdbReceiver.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +1 -1 impl. simple-read storage/ndb/src/ndbapi/NdbScanOperation.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +1 -0 no simple-read for scan (yet) storage/ndb/src/ndbapi/NdbTransaction.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +3 -3 rename bit storage/ndb/test/ndbapi/testBasic.cpp@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +13 -22 add testcase for simlpe-read storage/ndb/test/run-test/daily-basic-tests.txt@stripped, 2007-10-15 09:10:10+02:00, jonas@stripped +8 -0 add testcase storage/ndb/test/src/HugoOperations.cpp@stripped, 2007-10-15 09:10:11+02:00, jonas@stripped +1 -0 add simple-read diff -Nrup a/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp --- a/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp 2006-12-23 20:20:06 +01:00 +++ b/storage/ndb/include/kernel/signaldata/TcKeyConf.hpp 2007-10-15 09:10:10 +02:00 @@ -46,7 +46,7 @@ public: */ STATIC_CONST( StaticLength = 5 ); STATIC_CONST( OperationLength = 2 ); - STATIC_CONST( SimpleReadBit = (((Uint32)1) << 31) ); + STATIC_CONST( DirtyReadBit = (((Uint32)1) << 31) ); private: diff -Nrup a/storage/ndb/include/ndbapi/NdbOperation.hpp b/storage/ndb/include/ndbapi/NdbOperation.hpp --- a/storage/ndb/include/ndbapi/NdbOperation.hpp 2007-06-08 12:25:19 +02:00 +++ b/storage/ndb/include/ndbapi/NdbOperation.hpp 2007-10-15 09:10:10 +02:00 @@ -93,8 +93,9 @@ public: ,LM_CommittedRead ///< Ignore locks, read last committed value #ifndef DOXYGEN_SHOULD_SKIP_INTERNAL = 2, - LM_Dirty = 2 + LM_Dirty = 2, #endif + LM_SimpleRead = 3 ///< Read with shared lock, but release lock directly }; /** diff -Nrup a/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp b/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp --- a/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp 2006-12-23 20:20:11 +01:00 +++ b/storage/ndb/src/common/debugger/signaldata/TcKeyConf.cpp 2007-10-15 09:10:10 +02:00 @@ -51,11 +51,11 @@ printTCKEYCONF(FILE * output, const Uint (TcKeyConf::getMarkerFlag(confInfo) == 0)?"false":"true"); fprintf(output, "Operations:\n"); for(i = 0; i < noOfOp; i++) { - if(sig->operations[i].attrInfoLen > TcKeyConf::SimpleReadBit) + if(sig->operations[i].attrInfoLen > TcKeyConf::DirtyReadBit) fprintf(output, " apiOperationPtr: H'%.8x, simplereadnode: %u\n", sig->operations[i].apiOperationPtr, - sig->operations[i].attrInfoLen & (~TcKeyConf::SimpleReadBit)); + sig->operations[i].attrInfoLen & (~TcKeyConf::DirtyReadBit)); else fprintf(output, " apiOperationPtr: H'%.8x, attrInfoLen: %u\n", diff -Nrup a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp --- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-07-09 12:09:10 +02:00 +++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2007-10-15 09:10:10 +02:00 @@ -2025,7 +2025,6 @@ public: Uint8 reclenAiLqhkey; Uint8 m_offset_current_keybuf; Uint8 replicaType; - Uint8 simpleRead; Uint8 seqNoReplica; Uint8 tcNodeFailrec; Uint8 m_disk_table; diff -Nrup a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-10-08 16:05:27 +02:00 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2007-10-15 09:10:10 +02:00 @@ -3496,7 +3496,6 @@ void Dblqh::execLQHKEYREQ(Signal* signal regTcPtr->dirtyOp = LqhKeyReq::getDirtyFlag(Treqinfo); regTcPtr->opExec = LqhKeyReq::getInterpretedFlag(Treqinfo); regTcPtr->opSimple = LqhKeyReq::getSimpleFlag(Treqinfo); - regTcPtr->simpleRead = op == ZREAD && regTcPtr->opSimple; regTcPtr->seqNoReplica = LqhKeyReq::getSeqNoReplica(Treqinfo); UintR TreclenAiLqhkey = LqhKeyReq::getAIInLqhKeyReq(Treqinfo); regTcPtr->apiVersionNo = 0; @@ -3513,9 +3512,15 @@ void Dblqh::execLQHKEYREQ(Signal* signal regTcPtr->lockType = op == ZREAD_EX ? ZUPDATE : (Operation_t) op == ZWRITE ? ZINSERT : (Operation_t) op; } + + if (regTcPtr->dirtyOp) + { + ndbrequire(regTcPtr->opSimple); + } - CRASH_INSERTION2(5041, regTcPtr->simpleRead && - refToNode(signal->senderBlockRef()) != cownNodeid); + CRASH_INSERTION2(5041, (op == ZREAD && + (regTcPtr->opSimple || regTcPtr->dirtyOp) && + refToNode(signal->senderBlockRef()) != cownNodeid)); regTcPtr->reclenAiLqhkey = TreclenAiLqhkey; regTcPtr->currReclenAi = TreclenAiLqhkey; @@ -3687,8 +3692,8 @@ void Dblqh::execLQHKEYREQ(Signal* signal Uint8 TdistKey = LqhKeyReq::getDistributionKey(TtotReclenAi); if ((tfragDistKey != TdistKey) && (regTcPtr->seqNoReplica == 0) && - (regTcPtr->dirtyOp == ZFALSE) && - (regTcPtr->simpleRead == ZFALSE)) { + (regTcPtr->dirtyOp == ZFALSE)) + { /* ---------------------------------------------------------------------- * WE HAVE DIFFERENT OPINION THAN THE DIH THAT STARTED THE TRANSACTION. * THE REASON COULD BE THAT THIS IS AN OLD DISTRIBUTION WHICH IS NO LONGER @@ -4778,7 +4783,18 @@ void Dblqh::tupkeyConfLab(Signal* signal TRACE_OP(regTcPtr, "TUPKEYCONF"); - if (regTcPtr->simpleRead) { + if (readLen != 0) + { + jam(); + + /* SET BIT 15 IN REQINFO */ + LqhKeyReq::setApplicationAddressFlag(regTcPtr->reqinfo, 1); + regTcPtr->readlenAi = readLen; + }//if + + if (regTcPtr->operation == ZREAD && + (regTcPtr->opSimple || regTcPtr->dirtyOp)) + { jam(); /* ---------------------------------------------------------------------- * THE OPERATION IS A SIMPLE READ. @@ -4792,14 +4808,6 @@ void Dblqh::tupkeyConfLab(Signal* signal commitContinueAfterBlockedLab(signal); return; }//if - if (readLen != 0) - { - jam(); - - /* SET BIT 15 IN REQINFO */ - LqhKeyReq::setApplicationAddressFlag(regTcPtr->reqinfo, 1); - regTcPtr->readlenAi = readLen; - }//if regTcPtr->totSendlenAi = writeLen; ndbrequire(regTcPtr->totSendlenAi == regTcPtr->currTupAiLen); @@ -5178,12 +5186,15 @@ void Dblqh::packLqhkeyreqLab(Signal* sig /* */ /* ------------------------------------------------------------------------- */ sendLqhkeyconfTc(signal, regTcPtr->tcBlockref); - if (regTcPtr->dirtyOp != ZTRUE) { + if (! (regTcPtr->dirtyOp || + (regTcPtr->operation == ZREAD && regTcPtr->opSimple))) + { jam(); regTcPtr->transactionState = TcConnectionrec::PREPARED; releaseOprec(signal); } else { jam(); + /*************************************************************>*/ /* DIRTY WRITES ARE USED IN TWO SITUATIONS. THE FIRST */ /* SITUATION IS WHEN THEY ARE USED TO UPDATE COUNTERS AND*/ @@ -6406,8 +6417,8 @@ void Dblqh::commitContinueAfterBlockedLa Ptr regTcPtr = tcConnectptr; Ptr regFragptr = fragptr; Uint32 operation = regTcPtr.p->operation; - Uint32 simpleRead = regTcPtr.p->simpleRead; Uint32 dirtyOp = regTcPtr.p->dirtyOp; + Uint32 opSimple = regTcPtr.p->opSimple; if (regTcPtr.p->activeCreat != Fragrecord::AC_IGNORED) { if (operation != ZREAD) { TupCommitReq * const tupCommitReq = @@ -6465,20 +6476,29 @@ void Dblqh::commitContinueAfterBlockedLa EXECUTE_DIRECT(acc, GSN_ACC_COMMITREQ, signal, 1); } - if (simpleRead) { + if (dirtyOp) + { jam(); -/* ------------------------------------------------------------------------- */ -/*THE OPERATION WAS A SIMPLE READ THUS THE COMMIT PHASE IS ONLY NEEDED TO */ -/*RELEASE THE LOCKS. AT THIS POINT IN THE CODE THE LOCKS ARE RELEASED AND WE */ -/*ARE IN A POSITION TO SEND LQHKEYCONF TO TC. WE WILL ALSO RELEASE ALL */ -/*RESOURCES BELONGING TO THIS OPERATION SINCE NO MORE WORK WILL BE */ -/*PERFORMED. */ -/* ------------------------------------------------------------------------- */ + /** + * The dirtyRead does not send anything but TRANSID_AI from LDM + */ fragptr = regFragptr; tcConnectptr = regTcPtr; cleanUp(signal); return; - }//if + } + + /** + * The simpleRead will send a LQHKEYCONF + * but have already released the locks + */ + if (opSimple) + { + fragptr = regFragptr; + tcConnectptr = regTcPtr; + packLqhkeyreqLab(signal); + return; + } } }//if jamEntry(); @@ -7088,7 +7108,7 @@ void Dblqh::abortStateHandlerLab(Signal* /* ------------------------------------------------------------------------- */ return; }//if - if (regTcPtr->simpleRead) { + if (regTcPtr->opSimple) { jam(); /* ------------------------------------------------------------------------- */ /*A SIMPLE READ IS CURRENTLY RELEASING THE LOCKS OR WAITING FOR ACCESS TO */ @@ -7356,7 +7376,8 @@ void Dblqh::continueAbortLab(Signal* sig void Dblqh::continueAfterLogAbortWriteLab(Signal* signal) { TcConnectionrec * const regTcPtr = tcConnectptr.p; - if (regTcPtr->simpleRead) { + if (regTcPtr->operation == ZREAD && regTcPtr->dirtyOp) + { jam(); TcKeyRef * const tcKeyRef = (TcKeyRef *) signal->getDataPtrSend(); @@ -19027,7 +19048,6 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal ndbout << " operation = " << tcRec.p->operation<getProperty("LockMode", NdbOperation::LM_Read); int i = 0; HugoTransactions hugoTrans(*ctx->getTab()); while (igetNumLoops(); - int records = ctx->getNumRecords(); - int batchSize = ctx->getProperty("BatchSize", 1); - int i = 0; - bool dirty = true; - HugoTransactions hugoTrans(*ctx->getTab()); - while (igetType() == NdbDictionary::Index::OrderedIndex && pIndexScanOp == 0) {