From: Pekka Nousiainen Date: October 13 2011 9:04am Subject: bzr push into mysql-5.1-telco-6.3 branch (pekka.nousiainen:3455 to 3457) Bug#32040 List-Archive: http://lists.mysql.com/commits/141418 X-Bug: 32040 Message-Id: <20111013090455.B17415781A@cuda.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3457 Pekka Nousiainen 2011-10-13 bug#32040 a02_sig.diff get Signal* + new ndbrequire modified: storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 3456 Pekka Nousiainen 2011-10-13 bug#32040 a01_org.diff scan moved from locked tuple, try to unlock modified: storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 3455 magnus.blaudd@stripped 2011-10-10 Turn off --check-testcase when valgrinding to save time modified: mysql-test/mysql-test-run.pl === modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp' --- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-02-01 21:05:11 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2011-10-13 08:06:52 +0000 @@ -782,6 +782,8 @@ public: static Uint32 mt_buildIndexFragment_wrapper(void*); private: Uint32 mt_buildIndexFragment(struct mt_BuildIndxCtx*); + + Signal* c_signal_bug32040; }; // Dbtux::TupLoc === modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp' --- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-06-30 15:55:35 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp 2011-10-13 08:06:52 +0000 @@ -78,6 +78,8 @@ Dbtux::Dbtux(Block_context& ctx) : addRecSignal(GSN_DUMP_STATE_ORD, &Dbtux::execDUMP_STATE_ORD); addRecSignal(GSN_NODE_STATE_REP, &Dbtux::execNODE_STATE_REP, true); + + c_signal_bug32040 = 0; } Dbtux::~Dbtux() @@ -133,6 +135,7 @@ Dbtux::execSTTOR(Signal* signal) CLEAR_ERROR_INSERT_VALUE; c_tup = (Dbtup*)globalData.getBlock(DBTUP); ndbrequire(c_tup != 0); + c_signal_bug32040 = signal; break; case 3: jam(); === modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp' --- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-02-01 21:05:11 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxScan.cpp 2011-10-13 08:06:52 +0000 @@ -876,7 +876,11 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool } #endif // cannot be moved away from tuple we have locked +#if defined VM_TRACE || defined ERROR_INSERT ndbrequire(scan.m_state != ScanOp::Locked); +#else + ndbrequire(fromMaintReq || scan.m_state != ScanOp::Locked); +#endif // set up index keys for this operation setKeyAttrs(c_ctx, frag); // scan direction @@ -888,6 +892,24 @@ Dbtux::scanNext(ScanOpPtr scanPtr, bool NodeHandle origNode(frag); selectNode(origNode, pos.m_loc); ndbrequire(islinkScan(origNode, scanPtr)); + if (unlikely(scan.m_state == ScanOp::Locked)) { + // bug#32040 - no fix, just unlock and continue + jam(); + if (scan.m_accLockOp != RNIL) { + jam(); + Signal* signal = c_signal_bug32040; + AccLockReq* const lockReq = (AccLockReq*)signal->getDataPtrSend(); + lockReq->returnCode = RNIL; + lockReq->requestInfo = AccLockReq::Abort; + lockReq->accOpPtr = scan.m_accLockOp; + EXECUTE_DIRECT(DBACC, GSN_ACC_LOCKREQ, signal, AccLockReq::UndoSignalLength); + jamEntry(); + ndbrequire(lockReq->returnCode == AccLockReq::Success); + scan.m_accLockOp = RNIL; + scan.m_lockwait = false; + } + scan.m_state = ScanOp::Next; + } // current node in loop NodeHandle node = origNode; // copy of entry found No bundle (reason: useless for push emails).