From: Jonas Oreland Date: February 2 2012 8:11pm Subject: bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4845 to 4846) List-Archive: http://lists.mysql.com/commits/142930 Message-Id: <20120217084014.F20AD55C2B7@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4846 Jonas Oreland 2012-02-02 ndb - this patch removes some methods on NdbLogPartInfo, that makes incorrect assumptions (when increasing #LQHs). The users of these functions (2) are modified to solve problem differently modified: storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.cpp storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.hpp storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp 4845 Jonas Oreland 2012-02-02 ndb - 1) use NDB_ARRAY_SIZE to avoid repeating size of array 2) Set correct size of array which is dependant on NDBMT_BLOCK_INSTANCE_BITS. Not the actual max-block-instances in a particular version (for upgradability) modified: storage/ndb/include/kernel/ndb_limits.h storage/ndb/src/kernel/vm/SimulatedBlock.hpp storage/ndb/src/kernel/vm/mt.cpp === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.cpp 2011-11-14 12:02:56 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.cpp 2012-02-02 20:10:00 +0000 @@ -50,16 +50,6 @@ NdbLogPartInfo::partNoOwner(Uint32 lpno) return partMask.get(lpno); } -bool -NdbLogPartInfo::partNoOwner(Uint32 tabId, Uint32 fragId) -{ - Uint32 instanceKey = SimulatedBlock::getInstanceKey(tabId, fragId); - assert(instanceKey != 0); - Uint32 lpid = instanceKey - 1; - Uint32 lpno = partNoFromId(lpid); - return partNoOwner(lpno); -} - Uint32 NdbLogPartInfo::partNoIndex(Uint32 lpno) const { @@ -74,10 +64,3 @@ NdbLogPartInfo::partNoIndex(Uint32 lpno) assert(partNo[i] == lpno); return i; } - -Uint32 -NdbLogPartInfo::instanceKey(Uint32 lpno) const -{ - assert(lpno < LogParts); - return 1 + lpno; -} === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.hpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.hpp 2011-11-14 12:02:56 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhCommon.hpp 2012-02-02 20:10:00 +0000 @@ -30,10 +30,6 @@ * * log part number = log part id % 4 * - * Currently instance key (1-4) is - * - * instance key = 1 + log part number - * * This may change, and the code (except this file) must not assume * any connection between log part number and instance key. * @@ -49,9 +45,7 @@ struct NdbLogPartInfo { Bitmask<(NDB_MAX_LOG_PARTS+31)/32> partMask; Uint32 partNoFromId(Uint32 lpid) const; bool partNoOwner(Uint32 lpno) const; - bool partNoOwner(Uint32 tabId, Uint32 fragId); Uint32 partNoIndex(Uint32 lpno) const; - Uint32 instanceKey(Uint32 lpno) const; }; #endif === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2012-01-25 14:29:38 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2012-02-02 20:10:00 +0000 @@ -1244,12 +1244,13 @@ void Dblqh::execREAD_CONFIG_REQ(Signal* if (globalData.ndbLogParts != 4 && globalData.ndbLogParts != 8 && + globalData.ndbLogParts != 12 && globalData.ndbLogParts != 16) { char buf[255]; BaseString::snprintf(buf, sizeof(buf), "Trying to start with %d log parts, number of log parts can" - " only be set to 4, 8 or 16.", + " only be set to 4, 8, 12 or 16.", globalData.ndbLogParts); progError(__LINE__, NDBD_EXIT_INVALID_CONFIG, buf); } @@ -1912,7 +1913,7 @@ void Dblqh::execLQHFRAGREQ(Signal* signa ndbrequire(ptr.p->logPartNo == logPartNo); fragptr.p->m_log_part_ptr_i = ptr.i; - fragptr.p->lqhInstanceKey = lpinfo.instanceKey(logPartNo); + fragptr.p->lqhInstanceKey = getInstanceKey(tabptr.i, req->fragId); } if (DictTabInfo::isOrderedIndex(tabptr.p->tableType)) { === modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp' --- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp 2012-02-02 20:10:00 +0000 @@ -144,7 +144,6 @@ DbtuxProxy::sendINDEX_STAT_IMPL_REQ(Sign const Uint32 instance = workerInstance(ss.m_worker); NdbLogPartInfo lpinfo(instance); - //XXX remove unused switch (req->requestType) { case IndexStatReq::RT_START_MON: /* @@ -152,11 +151,6 @@ DbtuxProxy::sendINDEX_STAT_IMPL_REQ(Sign * to turn off any possible old assignment. In MT-LQH we also have * to check which worker owns the frag. */ - if (req->fragId != ZNIL - && !lpinfo.partNoOwner(req->indexId, req->fragId)) { - jam(); - req->fragId = ZNIL; - } break; case IndexStatReq::RT_STOP_MON: /* @@ -165,34 +159,8 @@ DbtuxProxy::sendINDEX_STAT_IMPL_REQ(Sign */ ndbrequire(req->fragId == ZNIL); break; - case IndexStatReq::RT_SCAN_FRAG: - ndbrequire(req->fragId != ZNIL); - if (!lpinfo.partNoOwner(req->indexId, req->fragId)) { - jam(); - skipReq(ss); - return; - } - break; - case IndexStatReq::RT_CLEAN_NEW: - case IndexStatReq::RT_CLEAN_OLD: - case IndexStatReq::RT_CLEAN_ALL: - ndbrequire(req->fragId == ZNIL); - break; - case IndexStatReq::RT_DROP_HEAD: - /* - * Only one client can do the PK-delete of the head record. We use - * of course the worker which owns the assigned fragment. - */ - ndbrequire(req->fragId != ZNIL); - if (!lpinfo.partNoOwner(req->indexId, req->fragId)) { - jam(); - skipReq(ss); - return; - } - break; default: ndbrequire(false); - break; } sendSignal(workerRef(ss.m_worker), GSN_INDEX_STAT_IMPL_REQ, @@ -256,36 +224,10 @@ DbtuxProxy::execINDEX_STAT_REP(Signal* s jamEntry(); const IndexStatRep* rep = (const IndexStatRep*)signal->getDataPtr(); - Ss_INDEX_STAT_REP& ss = ssSeize(); - ss.m_rep = *rep; - ndbrequire(signal->getLength() == IndexStatRep::SignalLength); - sendREQ(signal, ss); - ssRelease(ss); -} - -void -DbtuxProxy::sendINDEX_STAT_REP(Signal* signal, Uint32 ssId, - SectionHandle*) -{ - Ss_INDEX_STAT_REP& ss = ssFind(ssId); - - IndexStatRep* rep = (IndexStatRep*)signal->getDataPtrSend(); - *rep = ss.m_rep; - rep->senderData = reference(); - rep->senderData = ssId; - - const Uint32 instance = workerInstance(ss.m_worker); - NdbLogPartInfo lpinfo(instance); - - ndbrequire(rep->fragId != ZNIL); - if (!lpinfo.partNoOwner(rep->indexId, rep->fragId)) { - jam(); - skipReq(ss); - return; - } - sendSignal(workerRef(ss.m_worker), GSN_INDEX_STAT_REP, - signal, IndexStatRep::SignalLength, JBB); + Uint32 instance = getInstanceKey(rep->indexId, rep->fragId); + sendSignal(numberToRef(DBTUX, instance, getOwnNodeId()), + GSN_INDEX_STAT_REP, signal, signal->getLength(), JBB); } BLOCK_FUNCTIONS(DbtuxProxy) === modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp' --- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp 2011-06-30 15:59:25 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp 2012-02-02 20:10:00 +0000 @@ -69,20 +69,7 @@ protected: void sendINDEX_STAT_IMPL_CONF(Signal*, Uint32 ssId); // GSN_INDEX_STAT_REP - struct Ss_INDEX_STAT_REP : SsParallel { - IndexStatRep m_rep; - Ss_INDEX_STAT_REP() { - m_sendREQ = (SsFUNCREQ)&DbtuxProxy::sendINDEX_STAT_REP; - m_sendCONF = 0; - } - enum { poolSize = 1 }; - static SsPool& pool(LocalProxy* proxy) { - return ((DbtuxProxy*)proxy)->c_ss_INDEX_STAT_REP; - } - }; - SsPool c_ss_INDEX_STAT_REP; void execINDEX_STAT_REP(Signal*); - void sendINDEX_STAT_REP(Signal*, Uint32 ssId, SectionHandle*); }; #endif === modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp' --- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp 2011-11-11 08:42:31 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp 2012-02-02 20:10:00 +0000 @@ -497,23 +497,27 @@ Dbtux::statMonStart(Signal* signal, Stat Index& index = *c_indexPool.getPtr(req->indexId); D("statMonStart" << V(mon)); - // RT_START_MON also sends ZNIL to all non-monitoring nodes - if (req->fragId == ZNIL) + FragPtr fragPtr; + fragPtr.setNull(); + + if (req->fragId != ZNIL) { jam(); - index.m_statFragPtrI = RNIL; - D("non-monitoring node"); + findFrag(index, req->fragId, fragPtr); } - else + + if (fragPtr.i != RNIL) { jam(); - FragPtr fragPtr; - findFrag(index, req->fragId, fragPtr); - ndbrequire(fragPtr.i != RNIL); index.m_statFragPtrI = fragPtr.i; fragPtr.p->m_entryOps = 0; D("monitoring node" << V(index)); } + else + { + jam(); + index.m_statFragPtrI = RNIL; + } statMonConf(signal, mon); } No bundle (reason: useless for push emails).