diff --git a/storage/ndb/include/kernel/GlobalSignalNumbers.h b/storage/ndb/include/kernel/GlobalSignalNumbers.h index b449915d756..49f937ba221 100644 --- a/storage/ndb/include/kernel/GlobalSignalNumbers.h +++ b/storage/ndb/include/kernel/GlobalSignalNumbers.h @@ -126,7 +126,6 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_ACC_ABORTCONF 67 /* 68 not unused */ /* 69 not unused */ -/* 70 unused */ #define GSN_UPDATE_FRAG_DIST_KEY_ORD 70 #define GSN_ACC_ABORTREQ 71 #define GSN_ACC_CHECK_SCAN 72 @@ -183,7 +182,7 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_CNTR_START_CONF 118 #define GSN_CNTR_START_REP 119 /* 120 not unused */ -/* 121 unused */ +#define GSN_ROUTE_ORD 121 /* 122 unused */ /* 123 unused */ /* 124 unused */ diff --git a/storage/ndb/include/kernel/signaldata/RouteOrd.hpp b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp new file mode 100644 index 00000000000..fb4de08dd53 --- /dev/null +++ b/storage/ndb/include/kernel/signaldata/RouteOrd.hpp @@ -0,0 +1,35 @@ +/* Copyright (C) 2003 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifndef ROUTE_ORD_HPP +#define ROUTE_ORD_HPP + +#include "SignalData.hpp" +#include + +/** + * Request to allocate node id + */ +struct RouteOrd { + STATIC_CONST( SignalLength = 4 ); + + Uint32 dstRef; + Uint32 srcRef; + Uint32 gsn; + Uint32 cnt; +}; + +#endif diff --git a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp index 259f7480e8f..25a491422ef 100644 --- a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp +++ b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp @@ -635,5 +635,7 @@ const GsnName SignalNames [] = { ,{ GSN_UPDATE_FRAG_DIST_KEY_ORD, "UPDATE_FRAG_DIST_KEY_ORD" } ,{ GSN_DICT_COMMIT_REQ, "DICT_COMMIT_REQ"} + + ,{ GSN_ROUTE_ORD, "ROUTE_ORD" } }; const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName); diff --git a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 486ccbc5612..eff0910760e 100644 --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -62,6 +62,7 @@ #include #include #include +#include // Use DEBUG to print messages that should be // seen only when we debug the product @@ -7337,13 +7338,32 @@ Dblqh::sendTCKEYREF(Signal* signal, Uint32 ref, Uint32 routeRef, Uint32 cnt) } else { - jam(); - memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength); - signal->theData[0] = ZRETRY_TCKEYREF; - signal->theData[1] = cnt + 1; - signal->theData[2] = ref; - sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, - TcKeyRef::SignalLength + 3); + if (routeRef && + getNodeInfo(refToNode(routeRef)).m_version >= MAKE_VERSION(5,1,14)) + { + jam(); + memmove(signal->theData+25, signal->theData, 4*TcKeyRef::SignalLength); + RouteOrd* ord = (RouteOrd*)signal->getDataPtrSend(); + ord->dstRef = ref; + ord->srcRef = reference(); + ord->gsn = GSN_TCKEYREF; + ord->cnt = 0; + LinearSectionPtr ptr[3]; + ptr[0].p = signal->theData+25; + ptr[0].sz = TcKeyRef::SignalLength; + sendSignal(routeRef, GSN_ROUTE_ORD, signal, RouteOrd::SignalLength, JBB, + ptr, 1); + } + else + { + jam(); + memmove(signal->theData + 3, signal->theData, 4*TcKeyRef::SignalLength); + signal->theData[0] = ZRETRY_TCKEYREF; + signal->theData[1] = cnt + 1; + signal->theData[2] = ref; + sendSignalWithDelay(reference(), GSN_CONTINUEB, signal, 100, + TcKeyRef::SignalLength + 3); + } } } diff --git a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index 6fd6075bd99..52c082a5623 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -945,8 +945,7 @@ public: NF_CHECK_SCAN = 0x2, NF_CHECK_TRANSACTION = 0x4, NF_CHECK_DROP_TAB = 0x8, - NF_NODE_FAIL_BITS = 0xF, // All bits... - NF_STARTED = 0x10 + NF_NODE_FAIL_BITS = 0xF // All bits... }; Uint32 m_nf_bits; NdbNodeBitmask m_lqh_trans_conf; @@ -1286,7 +1285,7 @@ private: void execLQHKEYREF(Signal* signal); void execTRANSID_AI_R(Signal* signal); void execKEYINFO20_R(Signal* signal); - + void execROUTE_ORD(Signal* signal); // Received signals void execDUMP_STATE_ORD(Signal* signal); void execSEND_PACKED(Signal* signal); @@ -1324,7 +1323,6 @@ private: void execCOMMITCONF(Signal* signal); void execABORTCONF(Signal* signal); void execNODE_FAILREP(Signal* signal); - void execNODE_START_REP(Signal* signal); void execINCL_NODEREQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execAPI_FAILREQ(Signal* signal); diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index b5702f0a539..a0a14f5b13e 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -279,7 +279,7 @@ Dbtc::Dbtc(Block_context& ctx): addRecSignal(GSN_WAIT_DROP_TAB_CONF, &Dbtc::execWAIT_DROP_TAB_CONF); addRecSignal(GSN_ALTER_TAB_REQ, &Dbtc::execALTER_TAB_REQ); - addRecSignal(GSN_NODE_START_REP, &Dbtc::execNODE_START_REP, true); + addRecSignal(GSN_ROUTE_ORD, &Dbtc::execROUTE_ORD); cacheRecord = 0; apiConnectRecord = 0; diff --git a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 2b543b445b7..5d780747fc3 100644 --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -72,6 +72,8 @@ #include #include +#include + // Use DEBUG to print messages that should be // seen only when we debug the product #ifdef VM_TRACE @@ -3051,28 +3053,7 @@ void Dbtc::tckeyreq050Lab(Signal* signal) }//if }//for } - - if (regTcPtr->tcNodedata[0] != getOwnNodeId()) - { - jam(); - for (Uint32 i = 0; i < tnoOfBackup + 1; i++) - { - HostRecordPtr hostPtr; - hostPtr.i = regTcPtr->tcNodedata[i]; - ptrCheckGuard(hostPtr, chostFilesize, hostRecord); - if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED) - { - jam(); - if (i != 0) - { - jam(); - regTcPtr->tcNodedata[0] = hostPtr.i; - } - break; - } - } - }//if - } + }//if jam(); regTcPtr->lastReplicaNo = 0; regTcPtr->noOfNodes = 1; @@ -7029,19 +7010,6 @@ void Dbtc::execNODE_FAILREP(Signal* signal) } }//Dbtc::execNODE_FAILREP() -void -Dbtc::execNODE_START_REP(Signal* signal) -{ - Uint32 nodeId = signal->theData[0]; - hostptr.i = nodeId; - ptrCheckGuard(hostptr, chostFilesize, hostRecord); - if (hostptr.p->m_nf_bits == 0) - { - jam(); - hostptr.p->m_nf_bits |= HostRecord::NF_STARTED; - } -} - void Dbtc::checkNodeFailComplete(Signal* signal, Uint32 failedNodeId, @@ -13345,3 +13313,56 @@ Dbtc::TableRecord::getErrorCode(Uint32 schemaVersion) const { return 0; } +void +Dbtc::execROUTE_ORD(Signal* signal) +{ + jamEntry(); + if(!assembleFragments(signal)){ + jam(); + return; + } + + RouteOrd* ord = (RouteOrd*)signal->getDataPtr(); + Uint32 dstRef = ord->dstRef; + Uint32 srcRef = ord->srcRef; + Uint32 gsn = ord->gsn; + Uint32 cnt = ord->cnt; + + if (likely(getNodeInfo(refToNode(dstRef)).m_connected)) + { + jam(); + Uint32 secCount = signal->getNoOfSections(); + SegmentedSectionPtr ptr[3]; + ndbrequire(secCount >= 1 && secCount <= 3); + + jamLine(secCount); + for (Uint32 i = 0; igetSection(ptr[i], i); + + /** + * Put section 0 in signal->theData + */ + ndbrequire(ptr[0].sz <= 25); + copy(signal->theData, ptr[0]); + + signal->header.m_noOfSections = 0; + + /** + * Shift rest of sections + */ + for(Uint32 i = 1; isetSection(ptr[i], i - 1); + } + + sendSignal(dstRef, gsn, signal, ptr[0].sz, JBB); + + signal->header.m_noOfSections = 0; + signal->setSection(ptr[0], 0); + releaseSections(signal); + return ; + } + + warningEvent("Unable to route GSN: %d from %x to %x", + gsn, srcRef, dstRef); +}