Commit 135c7b5a authored by unknown's avatar unknown

bug#9892

  Make BUILDINDX RF_LOCAL aware


ndb/src/ndbapi/Ndbif.cpp:
  allow TCKEY_FAILREF w/ invalid magic number also when NDB_NODROPPED_SIGNAL
ndb/test/ndbapi/testIndex.cpp:
  Run only 1 update thread during NFNR2_O
parent 5a1af9ed
...@@ -9811,9 +9811,18 @@ Dbdict::execBUILDINDXREQ(Signal* signal) ...@@ -9811,9 +9811,18 @@ Dbdict::execBUILDINDXREQ(Signal* signal)
requestType == BuildIndxReq::RT_ALTER_INDEX || requestType == BuildIndxReq::RT_ALTER_INDEX ||
requestType == BuildIndxReq::RT_SYSTEMRESTART) { requestType == BuildIndxReq::RT_SYSTEMRESTART) {
jam(); jam();
const bool isLocal = req->getRequestFlag() & RequestFlag::RF_LOCAL;
NdbNodeBitmask receiverNodes = c_aliveNodes;
if (isLocal) {
receiverNodes.clear();
receiverNodes.set(getOwnNodeId());
}
if (signal->getLength() == BuildIndxReq::SignalLength) { if (signal->getLength() == BuildIndxReq::SignalLength) {
jam(); jam();
if (getOwnNodeId() != c_masterNodeId) {
if (!isLocal && getOwnNodeId() != c_masterNodeId) {
jam(); jam();
releaseSections(signal); releaseSections(signal);
...@@ -9828,7 +9837,7 @@ Dbdict::execBUILDINDXREQ(Signal* signal) ...@@ -9828,7 +9837,7 @@ Dbdict::execBUILDINDXREQ(Signal* signal)
} }
// forward initial request plus operation key to all // forward initial request plus operation key to all
req->setOpKey(++c_opRecordSequence); req->setOpKey(++c_opRecordSequence);
NodeReceiverGroup rg(DBDICT, c_aliveNodes); NodeReceiverGroup rg(DBDICT, receiverNodes);
sendSignal(rg, GSN_BUILDINDXREQ, sendSignal(rg, GSN_BUILDINDXREQ,
signal, BuildIndxReq::SignalLength + 1, JBB); signal, BuildIndxReq::SignalLength + 1, JBB);
return; return;
...@@ -9853,7 +9862,7 @@ Dbdict::execBUILDINDXREQ(Signal* signal) ...@@ -9853,7 +9862,7 @@ Dbdict::execBUILDINDXREQ(Signal* signal)
} }
c_opBuildIndex.add(opPtr); c_opBuildIndex.add(opPtr);
// master expects to hear from all // master expects to hear from all
opPtr.p->m_signalCounter = c_aliveNodes; opPtr.p->m_signalCounter = receiverNodes;
buildIndex_sendReply(signal, opPtr, false); buildIndex_sendReply(signal, opPtr, false);
return; return;
} }
...@@ -10208,10 +10217,20 @@ Dbdict::buildIndex_sendSlaveReq(Signal* signal, OpBuildIndexPtr opPtr) ...@@ -10208,10 +10217,20 @@ Dbdict::buildIndex_sendSlaveReq(Signal* signal, OpBuildIndexPtr opPtr)
req->setConnectionPtr(opPtr.p->key); req->setConnectionPtr(opPtr.p->key);
req->setRequestType(opPtr.p->m_requestType); req->setRequestType(opPtr.p->m_requestType);
req->addRequestFlag(opPtr.p->m_requestFlag); req->addRequestFlag(opPtr.p->m_requestFlag);
if(opPtr.p->m_requestFlag & RequestFlag::RF_LOCAL)
{
opPtr.p->m_signalCounter.clearWaitingFor();
opPtr.p->m_signalCounter.setWaitingFor(getOwnNodeId());
sendSignal(reference(), GSN_BUILDINDXREQ,
signal, BuildIndxReq::SignalLength, JBB);
}
else
{
opPtr.p->m_signalCounter = c_aliveNodes; opPtr.p->m_signalCounter = c_aliveNodes;
NodeReceiverGroup rg(DBDICT, c_aliveNodes); NodeReceiverGroup rg(DBDICT, c_aliveNodes);
sendSignal(rg, GSN_BUILDINDXREQ, sendSignal(rg, GSN_BUILDINDXREQ,
signal, BuildIndxReq::SignalLength, JBB); signal, BuildIndxReq::SignalLength, JBB);
}
} }
void void
......
...@@ -453,7 +453,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -453,7 +453,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
tFirstDataPtr = int2void(tFirstData); tFirstDataPtr = int2void(tFirstData);
if(tFirstDataPtr != 0){ if(tFirstDataPtr != 0){
tOp = void2rec_op(tFirstDataPtr); tOp = void2rec_op(tFirstDataPtr);
if (tOp->checkMagicNumber() == 0) { if (tOp->checkMagicNumber(false) == 0) {
tCon = tOp->theNdbCon; tCon = tOp->theNdbCon;
if (tCon != NULL) { if (tCon != NULL) {
if ((tCon->theSendStatus == NdbConnection::sendTC_OP) || if ((tCon->theSendStatus == NdbConnection::sendTC_OP) ||
...@@ -466,11 +466,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -466,11 +466,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
}//if }//if
}//if }//if
}//if }//if
} else { }
#ifdef VM_TRACE #ifdef VM_TRACE
ndbout_c("Recevied TCKEY_FAILREF wo/ operation"); ndbout_c("Recevied TCKEY_FAILREF wo/ operation");
#endif #endif
} return;
break; break;
} }
case GSN_TCKEYREF: case GSN_TCKEYREF:
......
...@@ -1329,7 +1329,7 @@ TESTCASE("NFNR2_O", ...@@ -1329,7 +1329,7 @@ TESTCASE("NFNR2_O",
INITIALIZER(runLoadTable); INITIALIZER(runLoadTable);
STEP(runRestarts); STEP(runRestarts);
STEP(runTransactions2); STEP(runTransactions2);
STEP(runTransactions2); //STEP(runTransactions2);
FINALIZER(runVerifyIndex); FINALIZER(runVerifyIndex);
FINALIZER(createRandomIndex_Drop); FINALIZER(createRandomIndex_Drop);
FINALIZER(createPkIndex_Drop); FINALIZER(createPkIndex_Drop);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment