ndb - wl2610

  Activly abort transactions (that's affected) during NF
  This removes a lot of bugs that can occur otherwise is using
    high value for TransactionDeadLockTimout
parent b14ed530
...@@ -44,7 +44,8 @@ private: ...@@ -44,7 +44,8 @@ private:
CHECK_WAIT_DROP_TAB_FAILED_LQH = 16, CHECK_WAIT_DROP_TAB_FAILED_LQH = 16,
TRIGGER_PENDING = 17, TRIGGER_PENDING = 17,
DelayTCKEYCONF = 18 DelayTCKEYCONF = 18,
ZNF_CHECK_TRANSACTIONS = 19
}; };
}; };
......
...@@ -636,6 +636,7 @@ public: ...@@ -636,6 +636,7 @@ public:
ConnectionState apiConnectstate; ConnectionState apiConnectstate;
UintR transid[2]; UintR transid[2];
UintR firstTcConnect; UintR firstTcConnect;
NdbNodeBitmask m_transaction_nodes;
//--------------------------------------------------- //---------------------------------------------------
// Second 16 byte cache line. Hot variables. // Second 16 byte cache line. Hot variables.
...@@ -941,6 +942,17 @@ public: ...@@ -941,6 +942,17 @@ public:
UintR noOfWordsTCINDXCONF; UintR noOfWordsTCINDXCONF;
UintR packedWordsTCINDXCONF[30]; UintR packedWordsTCINDXCONF[30];
BlockReference hostLqhBlockRef; BlockReference hostLqhBlockRef;
enum NodeFailBits
{
NF_TAKEOVER = 0x1,
NF_CHECK_SCAN = 0x2,
NF_CHECK_TRANSACTION = 0x4,
NF_CHECK_DROP_TAB = 0x8,
NF_NODE_FAIL_BITS = 0xF // All bits...
};
Uint32 m_nf_bits;
NdbNodeBitmask m_lqh_trans_conf;
}; /* p2c: size = 128 bytes */ }; /* p2c: size = 128 bytes */
typedef Ptr<HostRecord> HostRecordPtr; typedef Ptr<HostRecord> HostRecordPtr;
...@@ -1578,7 +1590,7 @@ private: ...@@ -1578,7 +1590,7 @@ private:
void wrongSchemaVersionErrorLab(Signal* signal); void wrongSchemaVersionErrorLab(Signal* signal);
void noFreeConnectionErrorLab(Signal* signal); void noFreeConnectionErrorLab(Signal* signal);
void tckeyreq050Lab(Signal* signal); void tckeyreq050Lab(Signal* signal);
void timeOutFoundLab(Signal* signal, UintR anAdd); void timeOutFoundLab(Signal* signal, UintR anAdd, Uint32 errCode);
void completeTransAtTakeOverLab(Signal* signal, UintR TtakeOverInd); void completeTransAtTakeOverLab(Signal* signal, UintR TtakeOverInd);
void completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd); void completeTransAtTakeOverDoLast(Signal* signal, UintR TtakeOverInd);
void completeTransAtTakeOverDoOne(Signal* signal, UintR TtakeOverInd); void completeTransAtTakeOverDoOne(Signal* signal, UintR TtakeOverInd);
...@@ -1600,6 +1612,9 @@ private: ...@@ -1600,6 +1612,9 @@ private:
void checkScanFragList(Signal*, Uint32 failedNodeId, ScanRecord * scanP, void checkScanFragList(Signal*, Uint32 failedNodeId, ScanRecord * scanP,
LocalDLList<ScanFragRec>::Head&); LocalDLList<ScanFragRec>::Head&);
void nodeFailCheckTransactions(Signal*,Uint32 transPtrI,Uint32 failedNodeId);
void checkNodeFailComplete(Signal* signal, Uint32 failedNodeId, Uint32 bit);
// Initialisation // Initialisation
void initData(); void initData();
void initRecords(); void initRecords();
...@@ -1626,6 +1641,7 @@ private: ...@@ -1626,6 +1641,7 @@ private:
HostRecord *hostRecord; HostRecord *hostRecord;
HostRecordPtr hostptr; HostRecordPtr hostptr;
UintR chostFilesize; UintR chostFilesize;
NdbNodeBitmask c_alive_nodes;
GcpRecord *gcpRecord; GcpRecord *gcpRecord;
GcpRecordPtr gcpPtr; GcpRecordPtr gcpPtr;
......
...@@ -262,6 +262,10 @@ void Dbtc::execCONTINUEB(Signal* signal) ...@@ -262,6 +262,10 @@ void Dbtc::execCONTINUEB(Signal* signal)
jam(); jam();
checkScanActiveInFailedLqh(signal, Tdata0, Tdata1); checkScanActiveInFailedLqh(signal, Tdata0, Tdata1);
return; return;
case TcContinueB::ZNF_CHECK_TRANSACTIONS:
jam();
nodeFailCheckTransactions(signal, Tdata0, Tdata1);
return;
case TcContinueB::CHECK_WAIT_DROP_TAB_FAILED_LQH: case TcContinueB::CHECK_WAIT_DROP_TAB_FAILED_LQH:
jam(); jam();
checkWaitDropTabFailedLqh(signal, Tdata0, Tdata1); checkWaitDropTabFailedLqh(signal, Tdata0, Tdata1);
...@@ -301,6 +305,7 @@ void Dbtc::execINCL_NODEREQ(Signal* signal) ...@@ -301,6 +305,7 @@ void Dbtc::execINCL_NODEREQ(Signal* signal)
hostptr.p->hostStatus = HS_ALIVE; hostptr.p->hostStatus = HS_ALIVE;
hostptr.p->takeOverStatus = TOS_IDLE; hostptr.p->takeOverStatus = TOS_IDLE;
signal->theData[0] = cownref; signal->theData[0] = cownref;
c_alive_nodes.set(hostptr.i);
sendSignal(tblockref, GSN_INCL_NODECONF, signal, 1, JBB); sendSignal(tblockref, GSN_INCL_NODECONF, signal, 1, JBB);
} }
...@@ -487,6 +492,7 @@ Dbtc::checkWaitDropTabFailedLqh(Signal* signal, Uint32 nodeId, Uint32 tableId) ...@@ -487,6 +492,7 @@ Dbtc::checkWaitDropTabFailedLqh(Signal* signal, Uint32 nodeId, Uint32 tableId)
* Finished * Finished
*/ */
jam(); jam();
checkNodeFailComplete(signal, nodeId, HostRecord::NF_CHECK_DROP_TAB);
return; return;
} }
...@@ -859,6 +865,7 @@ void Dbtc::execREAD_NODESCONF(Signal* signal) ...@@ -859,6 +865,7 @@ void Dbtc::execREAD_NODESCONF(Signal* signal)
jam(); jam();
con_lineNodes++; con_lineNodes++;
hostptr.p->hostStatus = HS_ALIVE; hostptr.p->hostStatus = HS_ALIVE;
c_alive_nodes.set(i);
}//if }//if
}//if }//if
}//for }//for
...@@ -2314,6 +2321,7 @@ void Dbtc::initApiConnectRec(Signal* signal, ...@@ -2314,6 +2321,7 @@ void Dbtc::initApiConnectRec(Signal* signal,
regApiPtr->commitAckMarker = RNIL; regApiPtr->commitAckMarker = RNIL;
regApiPtr->buddyPtr = RNIL; regApiPtr->buddyPtr = RNIL;
regApiPtr->currSavePointId = 0; regApiPtr->currSavePointId = 0;
regApiPtr->m_transaction_nodes.clear();
// Trigger data // Trigger data
releaseFiredTriggerData(&regApiPtr->theFiredTriggers), releaseFiredTriggerData(&regApiPtr->theFiredTriggers),
// Index data // Index data
...@@ -2921,6 +2929,10 @@ void Dbtc::tckeyreq050Lab(Signal* signal) ...@@ -2921,6 +2929,10 @@ void Dbtc::tckeyreq050Lab(Signal* signal)
signal->theData[0] = TdihConnectptr; signal->theData[0] = TdihConnectptr;
signal->theData[1] = Ttableref; signal->theData[1] = Ttableref;
signal->theData[2] = TdistrHashValue; signal->theData[2] = TdistrHashValue;
signal->theData[3] = 0;
signal->theData[4] = 0;
signal->theData[5] = 0;
signal->theData[6] = 0;
/*-------------------------------------------------------------*/ /*-------------------------------------------------------------*/
/* FOR EFFICIENCY REASONS WE AVOID THE SIGNAL SENDING HERE AND */ /* FOR EFFICIENCY REASONS WE AVOID THE SIGNAL SENDING HERE AND */
...@@ -3098,6 +3110,7 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3098,6 +3110,7 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
TcConnectRecord * const regTcPtr = tcConnectptr.p; TcConnectRecord * const regTcPtr = tcConnectptr.p;
ApiConnectRecord * const regApiPtr = apiConnectptr.p; ApiConnectRecord * const regApiPtr = apiConnectptr.p;
CacheRecord * const regCachePtr = cachePtr.p; CacheRecord * const regCachePtr = cachePtr.p;
UintR sig0, sig1, sig2, sig3, sig4, sig5, sig6;
#ifdef ERROR_INSERT #ifdef ERROR_INSERT
if (ERROR_INSERTED(8002)) { if (ERROR_INSERTED(8002)) {
systemErrorLab(signal); systemErrorLab(signal);
...@@ -3135,6 +3148,9 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3135,6 +3148,9 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
LqhKeyReq::setScanTakeOverFlag(tslrAttrLen, regCachePtr->scanTakeOverInd); LqhKeyReq::setScanTakeOverFlag(tslrAttrLen, regCachePtr->scanTakeOverInd);
Tdata10 = 0; Tdata10 = 0;
sig0 = regCachePtr->opSimple;
sig1 = regTcPtr->operation;
bool simpleRead = (sig1 == ZREAD && sig0 == ZTRUE);
LqhKeyReq::setKeyLen(Tdata10, regCachePtr->keylen); LqhKeyReq::setKeyLen(Tdata10, regCachePtr->keylen);
LqhKeyReq::setLastReplicaNo(Tdata10, regTcPtr->lastReplicaNo); LqhKeyReq::setLastReplicaNo(Tdata10, regTcPtr->lastReplicaNo);
LqhKeyReq::setLockType(Tdata10, regCachePtr->opLock); LqhKeyReq::setLockType(Tdata10, regCachePtr->opLock);
...@@ -3144,8 +3160,8 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3144,8 +3160,8 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
LqhKeyReq::setApplicationAddressFlag(Tdata10, 1); LqhKeyReq::setApplicationAddressFlag(Tdata10, 1);
LqhKeyReq::setDirtyFlag(Tdata10, regTcPtr->dirtyOp); LqhKeyReq::setDirtyFlag(Tdata10, regTcPtr->dirtyOp);
LqhKeyReq::setInterpretedFlag(Tdata10, regCachePtr->opExec); LqhKeyReq::setInterpretedFlag(Tdata10, regCachePtr->opExec);
LqhKeyReq::setSimpleFlag(Tdata10, regCachePtr->opSimple); LqhKeyReq::setSimpleFlag(Tdata10, sig0);
LqhKeyReq::setOperation(Tdata10, regTcPtr->operation); LqhKeyReq::setOperation(Tdata10, sig1);
/* ----------------------------------------------------------------------- /* -----------------------------------------------------------------------
* Sequential Number of first LQH = 0, bit 22-23 * Sequential Number of first LQH = 0, bit 22-23
* IF ATTRIBUTE INFORMATION IS SENT IN TCKEYREQ, * IF ATTRIBUTE INFORMATION IS SENT IN TCKEYREQ,
...@@ -3158,18 +3174,16 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3158,18 +3174,16 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
* ----------------------------------------------------------------------- */ * ----------------------------------------------------------------------- */
//LqhKeyReq::setAPIVersion(Tdata10, regCachePtr->apiVersionNo); //LqhKeyReq::setAPIVersion(Tdata10, regCachePtr->apiVersionNo);
Uint32 commitAckMarker = regTcPtr->commitAckMarker; Uint32 commitAckMarker = regTcPtr->commitAckMarker;
const Uint32 noOfLqhs = regTcPtr->noOfNodes;
if(commitAckMarker != RNIL){ if(commitAckMarker != RNIL){
jam(); jam();
LqhKeyReq::setMarkerFlag(Tdata10, 1); LqhKeyReq::setMarkerFlag(Tdata10, 1);
CommitAckMarker * tmp; CommitAckMarker * tmp = m_commitAckMarkerHash.getPtr(commitAckMarker);
tmp = m_commitAckMarkerHash.getPtr(commitAckMarker);
/** /**
* Populate LQH array * Populate LQH array
*/ */
const Uint32 noOfLqhs = regTcPtr->noOfNodes;
tmp->noOfLqhs = noOfLqhs; tmp->noOfLqhs = noOfLqhs;
for(Uint32 i = 0; i<noOfLqhs; i++){ for(Uint32 i = 0; i<noOfLqhs; i++){
tmp->lqhNodeId[i] = regTcPtr->tcNodedata[i]; tmp->lqhNodeId[i] = regTcPtr->tcNodedata[i];
...@@ -3180,7 +3194,6 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3180,7 +3194,6 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
/* NO READ LENGTH SENT FROM TC. SEQUENTIAL NUMBER IS 1 AND IT */ /* NO READ LENGTH SENT FROM TC. SEQUENTIAL NUMBER IS 1 AND IT */
/* IS SENT TO A PRIMARY NODE. */ /* IS SENT TO A PRIMARY NODE. */
/* ************************************************************> */ /* ************************************************************> */
UintR sig0, sig1, sig2, sig3, sig4, sig5, sig6;
LqhKeyReq * const lqhKeyReq = (LqhKeyReq *)signal->getDataPtrSend(); LqhKeyReq * const lqhKeyReq = (LqhKeyReq *)signal->getDataPtrSend();
...@@ -3204,6 +3217,14 @@ void Dbtc::sendlqhkeyreq(Signal* signal, ...@@ -3204,6 +3217,14 @@ void Dbtc::sendlqhkeyreq(Signal* signal,
sig5 = regTcPtr->clientData; sig5 = regTcPtr->clientData;
sig6 = regCachePtr->scanInfo; sig6 = regCachePtr->scanInfo;
if (! simpleRead)
{
regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[0]);
regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[1]);
regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[2]);
regApiPtr->m_transaction_nodes.set(regTcPtr->tcNodedata[3]);
}
lqhKeyReq->tableSchemaVersion = sig0; lqhKeyReq->tableSchemaVersion = sig0;
lqhKeyReq->fragmentData = sig1; lqhKeyReq->fragmentData = sig1;
lqhKeyReq->transId1 = sig2; lqhKeyReq->transId1 = sig2;
...@@ -4587,6 +4608,7 @@ void Dbtc::copyApi(Signal* signal) ...@@ -4587,6 +4608,7 @@ void Dbtc::copyApi(Signal* signal)
UintR TgcpPointer = regTmpApiPtr->gcpPointer; UintR TgcpPointer = regTmpApiPtr->gcpPointer;
UintR TgcpFilesize = cgcpFilesize; UintR TgcpFilesize = cgcpFilesize;
UintR TcommitAckMarker = regTmpApiPtr->commitAckMarker; UintR TcommitAckMarker = regTmpApiPtr->commitAckMarker;
NdbNodeBitmask Tnodes = regTmpApiPtr->m_transaction_nodes;
GcpRecord *localGcpRecord = gcpRecord; GcpRecord *localGcpRecord = gcpRecord;
regApiPtr->ndbapiBlockref = regTmpApiPtr->ndbapiBlockref; regApiPtr->ndbapiBlockref = regTmpApiPtr->ndbapiBlockref;
...@@ -4597,6 +4619,7 @@ void Dbtc::copyApi(Signal* signal) ...@@ -4597,6 +4619,7 @@ void Dbtc::copyApi(Signal* signal)
regApiPtr->transid[1] = Ttransid2; regApiPtr->transid[1] = Ttransid2;
regApiPtr->lqhkeyconfrec = Tlqhkeyconfrec; regApiPtr->lqhkeyconfrec = Tlqhkeyconfrec;
regApiPtr->commitAckMarker = TcommitAckMarker; regApiPtr->commitAckMarker = TcommitAckMarker;
regApiPtr->m_transaction_nodes = Tnodes;
gcpPtr.i = TgcpPointer; gcpPtr.i = TgcpPointer;
ptrCheckGuard(gcpPtr, TgcpFilesize, localGcpRecord); ptrCheckGuard(gcpPtr, TgcpFilesize, localGcpRecord);
...@@ -4607,6 +4630,7 @@ void Dbtc::copyApi(Signal* signal) ...@@ -4607,6 +4630,7 @@ void Dbtc::copyApi(Signal* signal)
regTmpApiPtr->commitAckMarker = RNIL; regTmpApiPtr->commitAckMarker = RNIL;
regTmpApiPtr->firstTcConnect = RNIL; regTmpApiPtr->firstTcConnect = RNIL;
regTmpApiPtr->lastTcConnect = RNIL; regTmpApiPtr->lastTcConnect = RNIL;
regTmpApiPtr->m_transaction_nodes.clear();
releaseAllSeizedIndexOperations(regTmpApiPtr); releaseAllSeizedIndexOperations(regTmpApiPtr);
}//Dbtc::copyApi() }//Dbtc::copyApi()
...@@ -4865,7 +4889,7 @@ void Dbtc::releaseTransResources(Signal* signal) ...@@ -4865,7 +4889,7 @@ void Dbtc::releaseTransResources(Signal* signal)
TcConnectRecordPtr localTcConnectptr; TcConnectRecordPtr localTcConnectptr;
UintR TtcConnectFilesize = ctcConnectFilesize; UintR TtcConnectFilesize = ctcConnectFilesize;
TcConnectRecord *localTcConnectRecord = tcConnectRecord; TcConnectRecord *localTcConnectRecord = tcConnectRecord;
apiConnectptr.p->m_transaction_nodes.clear();
localTcConnectptr.i = apiConnectptr.p->firstTcConnect; localTcConnectptr.i = apiConnectptr.p->firstTcConnect;
do { do {
jam(); jam();
...@@ -5269,7 +5293,8 @@ void Dbtc::execTC_COMMITREQ(Signal* signal) ...@@ -5269,7 +5293,8 @@ void Dbtc::execTC_COMMITREQ(Signal* signal)
break; break;
case CS_ABORTING: case CS_ABORTING:
jam(); jam();
errorCode = ZABORTINPROGRESS; errorCode = regApiPtr->returncode ?
regApiPtr->returncode : ZABORTINPROGRESS;
break; break;
case CS_START_SCAN: case CS_START_SCAN:
jam(); jam();
...@@ -5808,9 +5833,9 @@ void Dbtc::abort010Lab(Signal* signal) ...@@ -5808,9 +5833,9 @@ void Dbtc::abort010Lab(Signal* signal)
if (transP->firstTcConnect == RNIL) { if (transP->firstTcConnect == RNIL) {
jam(); jam();
/*-----------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
/* WE HAVE NO PARTICIPANTS IN THE TRANSACTION. */ /* WE HAVE NO PARTICIPANTS IN THE TRANSACTION. */
/*-----------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
releaseAbortResources(signal); releaseAbortResources(signal);
return; return;
}//if }//if
...@@ -6087,10 +6112,12 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) ...@@ -6087,10 +6112,12 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
if (api_timer != 0) { if (api_timer != 0) {
time_out_value= time_out_param + (api_con_ptr & mask_value); time_out_value= time_out_param + (api_con_ptr & mask_value);
time_passed= tc_timer - api_timer; time_passed= tc_timer - api_timer;
if (time_passed > time_out_value) { if (time_passed > time_out_value)
{
jam(); jam();
timeOutFoundLab(signal, api_con_ptr); timeOutFoundLab(signal, api_con_ptr, ZTIME_OUT_ERROR);
return; api_con_ptr++;
break;
} }
} }
} }
...@@ -6110,10 +6137,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr) ...@@ -6110,10 +6137,8 @@ void Dbtc::timeOutLoopStartLab(Signal* signal, Uint32 api_con_ptr)
return; return;
}//Dbtc::timeOutLoopStartLab() }//Dbtc::timeOutLoopStartLab()
void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr, Uint32 errCode)
{ {
sendContinueTimeOutControl(signal, TapiConPtr + 1);
apiConnectptr.i = TapiConPtr; apiConnectptr.i = TapiConPtr;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
...@@ -6126,7 +6151,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6126,7 +6151,8 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
<< "Time-out in state = " << apiConnectptr.p->apiConnectstate << "Time-out in state = " << apiConnectptr.p->apiConnectstate
<< " apiConnectptr.i = " << apiConnectptr.i << " apiConnectptr.i = " << apiConnectptr.i
<< " - exec: " << apiConnectptr.p->m_exec_flag << " - exec: " << apiConnectptr.p->m_exec_flag
<< " - place: " << c_apiConTimer_line[apiConnectptr.i]); << " - place: " << c_apiConTimer_line[apiConnectptr.i]
<< " code: " << errCode);
switch (apiConnectptr.p->apiConnectstate) { switch (apiConnectptr.p->apiConnectstate) {
case CS_STARTED: case CS_STARTED:
if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){ if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){
...@@ -6143,7 +6169,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6143,7 +6169,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
}//if }//if
} }
apiConnectptr.p->returnsignal = RS_TCROLLBACKREP; apiConnectptr.p->returnsignal = RS_TCROLLBACKREP;
apiConnectptr.p->returncode = ZTIME_OUT_ERROR; apiConnectptr.p->returncode = errCode;
abort010Lab(signal); abort010Lab(signal);
return; return;
case CS_RECEIVING: case CS_RECEIVING:
...@@ -6156,7 +6182,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6156,7 +6182,7 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
/* START ABORTING THE TRANSACTION. ALSO START CHECKING THE */ /* START ABORTING THE TRANSACTION. ALSO START CHECKING THE */
/* REMAINING TRANSACTIONS. */ /* REMAINING TRANSACTIONS. */
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
terrorCode = ZTIME_OUT_ERROR; terrorCode = errCode;
abortErrorLab(signal); abortErrorLab(signal);
return; return;
case CS_COMMITTING: case CS_COMMITTING:
...@@ -6820,6 +6846,8 @@ void Dbtc::execNODE_FAILREP(Signal* signal) ...@@ -6820,6 +6846,8 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
/* FAILED. */ /* FAILED. */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
hostptr.p->hostStatus = HS_DEAD; hostptr.p->hostStatus = HS_DEAD;
hostptr.p->m_nf_bits = HostRecord::NF_NODE_FAIL_BITS;
c_alive_nodes.clear(hostptr.i);
if (hostptr.p->takeOverStatus == TOS_COMPLETED) { if (hostptr.p->takeOverStatus == TOS_COMPLETED) {
jam(); jam();
...@@ -6832,14 +6860,7 @@ void Dbtc::execNODE_FAILREP(Signal* signal) ...@@ -6832,14 +6860,7 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
/* REMAINING WILL BE RELEASED WHEN THE TRANSACTION THAT */ /* REMAINING WILL BE RELEASED WHEN THE TRANSACTION THAT */
/* USED THEM IS COMPLETED. */ /* USED THEM IS COMPLETED. */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
{ hostptr.p->m_nf_bits &= ~HostRecord::NF_TAKEOVER;
NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
nfRep->blockNo = DBTC;
nfRep->nodeId = cownNodeid;
nfRep->failedNodeId = hostptr.i;
}
sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
NFCompleteRep::SignalLength, JBB);
} else { } else {
ndbrequire(hostptr.p->takeOverStatus == TOS_IDLE); ndbrequire(hostptr.p->takeOverStatus == TOS_IDLE);
hostptr.p->takeOverStatus = TOS_NODE_FAILED; hostptr.p->takeOverStatus = TOS_NODE_FAILED;
...@@ -6892,16 +6913,9 @@ void Dbtc::execNODE_FAILREP(Signal* signal) ...@@ -6892,16 +6913,9 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
/* MASTER IT MIGHT START A NEW TAKE OVER EVEN AFTER THE */ /* MASTER IT MIGHT START A NEW TAKE OVER EVEN AFTER THE */
/* CRASHED NODE HAVE ALREADY RECOVERED. */ /* CRASHED NODE HAVE ALREADY RECOVERED. */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
for(tmpHostptr.i = 1; tmpHostptr.i < MAX_NDB_NODES;tmpHostptr.i++) { NodeReceiverGroup rg(DBTC, c_alive_nodes);
jam();
ptrAss(tmpHostptr, hostRecord);
if (tmpHostptr.p->hostStatus == HS_ALIVE) {
jam();
tblockref = calcTcBlockRef(tmpHostptr.i);
signal->theData[0] = hostptr.i; signal->theData[0] = hostptr.i;
sendSignal(tblockref, GSN_TAKE_OVERTCCONF, signal, 1, JBB); sendSignal(rg, GSN_TAKE_OVERTCCONF, signal, 1, JBB);
}//if
}//for
}//if }//if
}//if }//if
}//for }//for
...@@ -6939,10 +6953,30 @@ void Dbtc::execNODE_FAILREP(Signal* signal) ...@@ -6939,10 +6953,30 @@ void Dbtc::execNODE_FAILREP(Signal* signal)
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
checkScanActiveInFailedLqh(signal, 0, hostptr.i); checkScanActiveInFailedLqh(signal, 0, hostptr.i);
checkWaitDropTabFailedLqh(signal, hostptr.i, 0); // nodeid, tableid checkWaitDropTabFailedLqh(signal, hostptr.i, 0); // nodeid, tableid
nodeFailCheckTransactions(signal, 0, hostptr.i);
}//for }//for
}//Dbtc::execNODE_FAILREP() }//Dbtc::execNODE_FAILREP()
void
Dbtc::checkNodeFailComplete(Signal* signal,
Uint32 failedNodeId,
Uint32 bit)
{
hostptr.i = failedNodeId;
ptrCheckGuard(hostptr, chostFilesize, hostRecord);
hostptr.p->m_nf_bits &= ~bit;
if (hostptr.p->m_nf_bits == 0)
{
NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
nfRep->blockNo = DBTC;
nfRep->nodeId = cownNodeid;
nfRep->failedNodeId = hostptr.i;
sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
NFCompleteRep::SignalLength, JBB);
}
}
void Dbtc::checkScanActiveInFailedLqh(Signal* signal, void Dbtc::checkScanActiveInFailedLqh(Signal* signal,
Uint32 scanPtrI, Uint32 scanPtrI,
Uint32 failedNodeId){ Uint32 failedNodeId){
...@@ -6984,8 +7018,44 @@ void Dbtc::checkScanActiveInFailedLqh(Signal* signal, ...@@ -6984,8 +7018,44 @@ void Dbtc::checkScanActiveInFailedLqh(Signal* signal,
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB); sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
return; return;
}//for }//for
checkNodeFailComplete(signal, failedNodeId, HostRecord::NF_CHECK_SCAN);
}
void
Dbtc::nodeFailCheckTransactions(Signal* signal,
Uint32 transPtrI,
Uint32 failedNodeId)
{
jam();
Ptr<ApiConnectRecord> transPtr;
for (transPtr.i = transPtrI; transPtr.i < capiConnectFilesize; transPtr.i++)
{
ptrCheckGuard(transPtr, capiConnectFilesize, apiConnectRecord);
if (transPtr.p->m_transaction_nodes.get(failedNodeId))
{
jam();
// Force timeout regardless of state
Uint32 save = c_appl_timeout_value;
c_appl_timeout_value = 1;
setApiConTimer(transPtr.i, 0, __LINE__);
timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT);
c_appl_timeout_value = save;
}
// Send CONTINUEB to continue later
signal->theData[0] = TcContinueB::ZNF_CHECK_TRANSACTIONS;
signal->theData[1] = transPtr.i + 1; // Check next
signal->theData[2] = failedNodeId;
sendSignal(cownref, GSN_CONTINUEB, signal, 3, JBB);
return;
}
checkNodeFailComplete(signal, failedNodeId,
HostRecord::NF_CHECK_TRANSACTION);
} }
void void
Dbtc::checkScanFragList(Signal* signal, Dbtc::checkScanFragList(Signal* signal,
Uint32 failedNodeId, Uint32 failedNodeId,
...@@ -7025,14 +7095,7 @@ void Dbtc::execTAKE_OVERTCCONF(Signal* signal) ...@@ -7025,14 +7095,7 @@ void Dbtc::execTAKE_OVERTCCONF(Signal* signal)
/* USED THEM IS COMPLETED. */ /* USED THEM IS COMPLETED. */
/*------------------------------------------------------------*/ /*------------------------------------------------------------*/
hostptr.p->takeOverStatus = TOS_COMPLETED; hostptr.p->takeOverStatus = TOS_COMPLETED;
{ checkNodeFailComplete(signal, hostptr.i, HostRecord::NF_TAKEOVER);
NFCompleteRep * const nfRep = (NFCompleteRep *)&signal->theData[0];
nfRep->blockNo = DBTC;
nfRep->nodeId = cownNodeid;
nfRep->failedNodeId = hostptr.i;
}
sendSignal(cdihblockref, GSN_NF_COMPLETEREP, signal,
NFCompleteRep::SignalLength, JBB);
break; break;
case TOS_COMPLETED: case TOS_COMPLETED:
jam(); jam();
...@@ -7979,6 +8042,7 @@ void Dbtc::initApiConnectFail(Signal* signal) ...@@ -7979,6 +8042,7 @@ void Dbtc::initApiConnectFail(Signal* signal)
apiConnectptr.p->ndbapiBlockref = 0; apiConnectptr.p->ndbapiBlockref = 0;
apiConnectptr.p->ndbapiConnect = 0; apiConnectptr.p->ndbapiConnect = 0;
apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->m_transaction_nodes.clear();
setApiConTimer(apiConnectptr.i, 0, __LINE__); setApiConTimer(apiConnectptr.i, 0, __LINE__);
switch(ttransStatus){ switch(ttransStatus){
case LqhTransConf::Committed: case LqhTransConf::Committed:
...@@ -9756,6 +9820,7 @@ void Dbtc::initApiConnect(Signal* signal) ...@@ -9756,6 +9820,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL; apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->currSavePointId = 0;
apiConnectptr.p->m_transaction_nodes.clear();
}//for }//for
apiConnectptr.i = tiacTmp - 1; apiConnectptr.i = tiacTmp - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
...@@ -9783,6 +9848,7 @@ void Dbtc::initApiConnect(Signal* signal) ...@@ -9783,6 +9848,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL; apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->currSavePointId = 0;
apiConnectptr.p->m_transaction_nodes.clear();
}//for }//for
apiConnectptr.i = (2 * tiacTmp) - 1; apiConnectptr.i = (2 * tiacTmp) - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
...@@ -9810,6 +9876,7 @@ void Dbtc::initApiConnect(Signal* signal) ...@@ -9810,6 +9876,7 @@ void Dbtc::initApiConnect(Signal* signal)
apiConnectptr.p->executingIndexOp = RNIL; apiConnectptr.p->executingIndexOp = RNIL;
apiConnectptr.p->buddyPtr = RNIL; apiConnectptr.p->buddyPtr = RNIL;
apiConnectptr.p->currSavePointId = 0; apiConnectptr.p->currSavePointId = 0;
apiConnectptr.p->m_transaction_nodes.clear();
}//for }//for
apiConnectptr.i = (3 * tiacTmp) - 1; apiConnectptr.i = (3 * tiacTmp) - 1;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
...@@ -9877,6 +9944,7 @@ void Dbtc::inithost(Signal* signal) ...@@ -9877,6 +9944,7 @@ void Dbtc::inithost(Signal* signal)
hostptr.p->noOfPackedWordsLqh = 0; hostptr.p->noOfPackedWordsLqh = 0;
hostptr.p->hostLqhBlockRef = calcLqhBlockRef(hostptr.i); hostptr.p->hostLqhBlockRef = calcLqhBlockRef(hostptr.i);
}//for }//for
c_alive_nodes.clear();
}//Dbtc::inithost() }//Dbtc::inithost()
void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0, void Dbtc::initialiseRecordsLab(Signal* signal, UintR Tdata0,
...@@ -10126,6 +10194,7 @@ void Dbtc::releaseAbortResources(Signal* signal) ...@@ -10126,6 +10194,7 @@ void Dbtc::releaseAbortResources(Signal* signal)
}//while }//while
apiConnectptr.p->firstTcConnect = RNIL; apiConnectptr.p->firstTcConnect = RNIL;
apiConnectptr.p->lastTcConnect = RNIL; apiConnectptr.p->lastTcConnect = RNIL;
apiConnectptr.p->m_transaction_nodes.clear();
// MASV let state be CS_ABORTING until all // MASV let state be CS_ABORTING until all
// signals in the "air" have been received. Reset to CS_CONNECTED // signals in the "air" have been received. Reset to CS_CONNECTED
...@@ -10199,6 +10268,7 @@ void Dbtc::releaseApiCon(Signal* signal, UintR TapiConnectPtr) ...@@ -10199,6 +10268,7 @@ void Dbtc::releaseApiCon(Signal* signal, UintR TapiConnectPtr)
cfirstfreeApiConnect = TlocalApiConnectptr.i; cfirstfreeApiConnect = TlocalApiConnectptr.i;
setApiConTimer(TlocalApiConnectptr.i, 0, __LINE__); setApiConTimer(TlocalApiConnectptr.i, 0, __LINE__);
TlocalApiConnectptr.p->apiConnectstate = CS_DISCONNECTED; TlocalApiConnectptr.p->apiConnectstate = CS_DISCONNECTED;
ndbassert(TlocalApiConnectptr.p->m_transaction_nodes.isclear());
ndbassert(TlocalApiConnectptr.p->apiScanRec == RNIL); ndbassert(TlocalApiConnectptr.p->apiScanRec == RNIL);
TlocalApiConnectptr.p->ndbapiBlockref = 0; TlocalApiConnectptr.p->ndbapiBlockref = 0;
}//Dbtc::releaseApiCon() }//Dbtc::releaseApiCon()
...@@ -10734,6 +10804,34 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) ...@@ -10734,6 +10804,34 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal)
c_theIndexOperationPool.getSize(), c_theIndexOperationPool.getSize(),
c_theIndexOperationPool.getNoOfFree()); c_theIndexOperationPool.getNoOfFree());
} }
if (dumpState->args[0] == 2514)
{
if (signal->getLength() == 2)
{
dumpState->args[0] = DumpStateOrd::TcDumpOneApiConnectRec;
execDUMP_STATE_ORD(signal);
}
NodeReceiverGroup rg(CMVMI, c_alive_nodes);
dumpState->args[0] = 15;
sendSignal(rg, GSN_DUMP_STATE_ORD, signal, 1, JBB);
signal->theData[0] = 2515;
sendSignalWithDelay(cownref, GSN_DUMP_STATE_ORD, signal, 1000, 1);
return;
}
if (dumpState->args[0] == 2515)
{
NdbNodeBitmask mask = c_alive_nodes;
mask.clear(getOwnNodeId());
NodeReceiverGroup rg(NDBCNTR, mask);
sendSignal(rg, GSN_SYSTEM_ERROR, signal, 1, JBB);
sendSignalWithDelay(cownref, GSN_SYSTEM_ERROR, signal, 300, 1);
return;
}
}//Dbtc::execDUMP_STATE_ORD() }//Dbtc::execDUMP_STATE_ORD()
void Dbtc::execSET_VAR_REQ(Signal* signal) void Dbtc::execSET_VAR_REQ(Signal* signal)
......
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