diff --git a/ndb/src/common/mgmcommon/ConfigInfo.cpp b/ndb/src/common/mgmcommon/ConfigInfo.cpp index 6076b56de04..1dffd6751b5 100644 --- a/ndb/src/common/mgmcommon/ConfigInfo.cpp +++ b/ndb/src/common/mgmcommon/ConfigInfo.cpp @@ -494,7 +494,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = { ConfigInfo::USED, true, ConfigInfo::INT, - 4000, + 6000, 70, MAX_INT_RNIL }, @@ -2586,7 +2586,6 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ Uint32 id1= 0, id2= 0; require(ctx.m_currentSection->get("NodeId1", &id1)); require(ctx.m_currentSection->get("NodeId2", &id2)); - id1 = id1 < id2 ? id1 : id2; const Properties * node; @@ -2619,7 +2618,6 @@ fixPortNumber(InitConfigFileParser::Context & ctx, const char * data){ } ctx.m_userProperties.put("ServerPortBase", base); } - port= base + adder; ctx.m_userProperties.put("ServerPort_", id1, port); } diff --git a/ndb/src/common/mgmcommon/IPCConfig.cpp b/ndb/src/common/mgmcommon/IPCConfig.cpp index a8536bf4fa7..a76c541f3f6 100644 --- a/ndb/src/common/mgmcommon/IPCConfig.cpp +++ b/ndb/src/common/mgmcommon/IPCConfig.cpp @@ -445,7 +445,6 @@ IPCConfig::configureTransporters(Uint32 nodeId, if(iter.get(CFG_TCP_RECEIVE_BUFFER_SIZE, &conf.maxReceiveSize)) break; conf.port= tmp_server_port; - const char * proxy; if (!iter.get(CFG_TCP_PROXY, &proxy)) { if (strlen(proxy) > 0 && nodeId2 == nodeId) { diff --git a/ndb/src/common/transporter/Transporter.cpp b/ndb/src/common/transporter/Transporter.cpp index cfd75eb6c5e..2c8a43fff1b 100644 --- a/ndb/src/common/transporter/Transporter.cpp +++ b/ndb/src/common/transporter/Transporter.cpp @@ -93,7 +93,6 @@ bool Transporter::connect_client() { if(m_connected) return true; - NDB_SOCKET_TYPE sockfd = m_socket_client->connect(); if (sockfd < 0) @@ -102,7 +101,6 @@ Transporter::connect_client() { // send info about own id SocketOutputStream s_output(sockfd); s_output.println("%d", localNodeId); - // get remote id int nodeId; SocketInputStream s_input(sockfd); @@ -115,7 +113,6 @@ Transporter::connect_client() { NDB_CLOSE_SOCKET(sockfd); return false; } - bool res = connect_client_impl(sockfd); if(res){ m_connected = true; diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp index aa1913e3040..01f1f74f053 100644 --- a/ndb/src/common/transporter/TransporterRegistry.cpp +++ b/ndb/src/common/transporter/TransporterRegistry.cpp @@ -200,8 +200,7 @@ TransporterRegistry::createTransporter(TCP_TransporterConfiguration *config) { if(theTransporters[config->remoteNodeId] != NULL) return false; - - + TCP_Transporter * t = new TCP_Transporter(*this, config->sendBufferSize, config->maxReceiveSize, diff --git a/ndb/src/common/util/SocketClient.cpp b/ndb/src/common/util/SocketClient.cpp index b7769633875..ec837babc24 100644 --- a/ndb/src/common/util/SocketClient.cpp +++ b/ndb/src/common/util/SocketClient.cpp @@ -70,19 +70,21 @@ SocketClient::connect() return -1; } } - const int r = ::connect(m_sockfd, (struct sockaddr*) &m_servaddr, sizeof(m_servaddr)); - if (r == -1) + if (r == -1) { + NDB_CLOSE_SOCKET(m_sockfd); + m_sockfd= -1; return -1; + } - if (m_auth) + if (m_auth) { if (!m_auth->client_authenticate(m_sockfd)) { NDB_CLOSE_SOCKET(m_sockfd); m_sockfd= -1; return -1; } - + } NDB_SOCKET_TYPE sockfd= m_sockfd; m_sockfd= -1; diff --git a/ndb/src/common/util/SocketServer.cpp b/ndb/src/common/util/SocketServer.cpp index 44c57c766f8..0cc06a54496 100644 --- a/ndb/src/common/util/SocketServer.cpp +++ b/ndb/src/common/util/SocketServer.cpp @@ -147,7 +147,6 @@ SocketServer::doAccept(){ ServiceInstance & si = m_services[i]; if(FD_ISSET(si.m_socket, &readSet)){ - NDB_SOCKET_TYPE childSock = accept(si.m_socket, 0, 0); if(childSock == NDB_INVALID_SOCKET){ continue; diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index ef0f91841dc..0f25391fccb 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -480,7 +480,6 @@ void Cmvmi::execDISCONNECT_REP(Signal *signal) void Cmvmi::execCONNECT_REP(Signal *signal){ const Uint32 hostId = signal->theData[0]; - jamEntry(); const NodeInfo::NodeType type = (NodeInfo::NodeType)getNodeInfo(hostId).m_type; diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 10fd703e387..01b5f283143 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -757,6 +757,7 @@ void Dbacc::initialiseDirRec(Signal* signal) DirectoryarrayPtr idrDirptr; ndbrequire(cdirarraysize > 0); for (idrDirptr.i = 0; idrDirptr.i < cdirarraysize; idrDirptr.i++) { + refresh_watch_dog(); ptrAss(idrDirptr, directoryarray); for (Uint32 i = 0; i <= 255; i++) { idrDirptr.p->pagep[i] = RNIL; @@ -776,6 +777,7 @@ void Dbacc::initialiseDirRangeRec(Signal* signal) ndbrequire(cdirrangesize > 0); for (idrDirRangePtr.i = 0; idrDirRangePtr.i < cdirrangesize; idrDirRangePtr.i++) { + refresh_watch_dog(); ptrAss(idrDirRangePtr, dirRange); idrDirRangePtr.p->dirArray[0] = idrDirRangePtr.i + 1; for (Uint32 i = 1; i < 256; i++) { @@ -798,6 +800,7 @@ void Dbacc::initialiseFragRec(Signal* signal) ndbrequire(cfragmentsize > 0); for (regFragPtr.i = 0; regFragPtr.i < cfragmentsize; regFragPtr.i++) { jam(); + refresh_watch_dog(); ptrAss(regFragPtr, fragmentrec); initFragGeneral(regFragPtr); regFragPtr.p->nextfreefrag = regFragPtr.i + 1; @@ -876,6 +879,7 @@ void Dbacc::initialiseOperationRec(Signal* signal) { ndbrequire(coprecsize > 0); for (operationRecPtr.i = 0; operationRecPtr.i < coprecsize; operationRecPtr.i++) { + refresh_watch_dog(); ptrAss(operationRecPtr, operationrec); operationRecPtr.p->transactionstate = IDLE; operationRecPtr.p->operation = ZUNDEFINED_OP; @@ -898,6 +902,7 @@ void Dbacc::initialiseOverflowRec(Signal* signal) ndbrequire(coverflowrecsize > 0); for (iorOverflowRecPtr.i = 0; iorOverflowRecPtr.i < coverflowrecsize; iorOverflowRecPtr.i++) { + refresh_watch_dog(); ptrAss(iorOverflowRecPtr, overflowRecord); iorOverflowRecPtr.p->nextfreeoverrec = iorOverflowRecPtr.i + 1; }//for @@ -958,6 +963,7 @@ void Dbacc::initialiseRootfragRec(Signal* signal) { ndbrequire(crootfragmentsize > 0); for (rootfragrecptr.i = 0; rootfragrecptr.i < crootfragmentsize; rootfragrecptr.i++) { + refresh_watch_dog(); ptrAss(rootfragrecptr, rootfragmentrec); rootfragrecptr.p->nextroot = rootfragrecptr.i + 1; rootfragrecptr.p->fragmentptr[0] = RNIL; @@ -1013,6 +1019,7 @@ void Dbacc::initialiseTableRec(Signal* signal) { ndbrequire(ctablesize > 0); for (tabptr.i = 0; tabptr.i < ctablesize; tabptr.i++) { + refresh_watch_dog(); ptrAss(tabptr, tabrec); for (Uint32 i = 0; i < NO_OF_FRAG_PER_NODE; i++) { tabptr.p->fragholder[i] = RNIL; diff --git a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp index bd191d112f1..143a96e49d3 100644 --- a/ndb/src/kernel/blocks/dbdict/Dbdict.cpp +++ b/ndb/src/kernel/blocks/dbdict/Dbdict.cpp @@ -1313,6 +1313,7 @@ void Dbdict::initTableRecords() TableRecordPtr tablePtr; while (1) { jam(); + refresh_watch_dog(); c_tableRecordPool.seize(tablePtr); if (tablePtr.i == RNIL) { jam(); @@ -1373,6 +1374,7 @@ void Dbdict::initTriggerRecords() TriggerRecordPtr triggerPtr; while (1) { jam(); + refresh_watch_dog(); c_triggerRecordPool.seize(triggerPtr); if (triggerPtr.i == RNIL) { jam(); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 557fed03498..3884bbda960 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -6896,6 +6896,7 @@ void Dbdih::initialiseFragstore() cfirstfragstore = RNIL; cremainingfrags = 0; for (i = 0; i < noOfChunks; i++) { + refresh_watch_dog(); ptrCheckGuard(fragPtr, cfragstoreFileSize, fragmentstore); fragPtr.p->nextFragmentChunk = cfirstfragstore; cfirstfragstore = fragPtr.i; @@ -11107,6 +11108,7 @@ void Dbdih::initialiseRecordsLab(Signal* signal, jam(); /******** INTIALIZING API CONNECT RECORDS ********/ for (apiConnectptr.i = 0; apiConnectptr.i < capiConnectFileSize; apiConnectptr.i++) { + refresh_watch_dog(); ptrAss(apiConnectptr, apiConnectRecord); apiConnectptr.p->nextApi = RNIL; }//for @@ -11118,6 +11120,7 @@ void Dbdih::initialiseRecordsLab(Signal* signal, jam(); /****** CONNECT ******/ for (connectPtr.i = 0; connectPtr.i < cconnectFileSize; connectPtr.i++) { + refresh_watch_dog(); ptrAss(connectPtr, connectRecord); connectPtr.p->userpointer = RNIL; connectPtr.p->userblockref = ZNIL; @@ -11182,6 +11185,7 @@ void Dbdih::initialiseRecordsLab(Signal* signal, jam(); /******* PAGE RECORD ******/ for (pagePtr.i = 0; pagePtr.i < cpageFileSize; pagePtr.i++) { + refresh_watch_dog(); ptrAss(pagePtr, pageRecord); pagePtr.p->nextfreepage = pagePtr.i + 1; }//for @@ -11198,6 +11202,7 @@ void Dbdih::initialiseRecordsLab(Signal* signal, /******* REPLICA RECORD ******/ for (initReplicaPtr.i = 0; initReplicaPtr.i < creplicaFileSize; initReplicaPtr.i++) { + refresh_watch_dog(); ptrAss(initReplicaPtr, replicaRecord); initReplicaPtr.p->lcpIdStarted = 0; initReplicaPtr.p->lcpOngoingFlag = false; @@ -11217,6 +11222,7 @@ void Dbdih::initialiseRecordsLab(Signal* signal, /********* TAB-DESCRIPTOR ********/ for (loopTabptr.i = 0; loopTabptr.i < ctabFileSize; loopTabptr.i++) { ptrAss(loopTabptr, tabRecord); + refresh_watch_dog(); initTable(loopTabptr); }//for break; diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 28a8a3c0065..5341bd8acf9 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -15957,6 +15957,7 @@ void Dblqh::initialiseAttrbuf(Signal* signal) for (attrinbufptr.i = 0; attrinbufptr.i < cattrinbufFileSize; attrinbufptr.i++) { + refresh_watch_dog(); ptrAss(attrinbufptr, attrbuf); attrinbufptr.p->attrbuf[ZINBUF_NEXT] = attrinbufptr.i + 1; }//for @@ -15979,6 +15980,7 @@ void Dblqh::initialiseDatabuf(Signal* signal) { if (cdatabufFileSize != 0) { for (databufptr.i = 0; databufptr.i < cdatabufFileSize; databufptr.i++) { + refresh_watch_dog(); ptrAss(databufptr, databuf); databufptr.p->nextDatabuf = databufptr.i + 1; }//for @@ -16000,6 +16002,7 @@ void Dblqh::initialiseFragrec(Signal* signal) { if (cfragrecFileSize != 0) { for (fragptr.i = 0; fragptr.i < cfragrecFileSize; fragptr.i++) { + refresh_watch_dog(); ptrAss(fragptr, fragrecord); fragptr.p->fragStatus = Fragrecord::FREE; fragptr.p->fragActiveStatus = ZFALSE; @@ -16132,6 +16135,7 @@ void Dblqh::initialiseLogPage(Signal* signal) { if (clogPageFileSize != 0) { for (logPagePtr.i = 0; logPagePtr.i < clogPageFileSize; logPagePtr.i++) { + refresh_watch_dog(); ptrAss(logPagePtr, logPageRecord); logPagePtr.p->logPageWord[ZNEXT_PAGE] = logPagePtr.i + 1; }//for @@ -16310,6 +16314,7 @@ void Dblqh::initialiseScanrec(Signal* signal) DLList tmp(c_scanRecordPool); while (tmp.seize(scanptr)){ //new (scanptr.p) ScanRecord(); + refresh_watch_dog(); scanptr.p->scanType = ScanRecord::ST_IDLE; scanptr.p->scanState = ScanRecord::SCAN_FREE; scanptr.p->scanTcWaiting = ZFALSE; @@ -16327,6 +16332,7 @@ void Dblqh::initialiseTabrec(Signal* signal) { if (ctabrecFileSize != 0) { for (tabptr.i = 0; tabptr.i < ctabrecFileSize; tabptr.i++) { + refresh_watch_dog(); ptrAss(tabptr, tablerec); tabptr.p->tableStatus = Tablerec::NOT_DEFINED; tabptr.p->usageCount = 0; @@ -16348,6 +16354,7 @@ void Dblqh::initialiseTcrec(Signal* signal) for (tcConnectptr.i = 0; tcConnectptr.i < ctcConnectrecFileSize; tcConnectptr.i++) { + refresh_watch_dog(); ptrAss(tcConnectptr, tcConnectionrec); tcConnectptr.p->transactionState = TcConnectionrec::TC_NOT_CONNECTED; tcConnectptr.p->tcScanRec = RNIL; diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index b3e6eb0dc6a..3246fcc5e6f 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -9584,6 +9584,7 @@ void Dbtc::initApiConnect(Signal* signal) ndbrequire(tiacTmp > 0); guard4 = tiacTmp + 1; for (cachePtr.i = 0; cachePtr.i < guard4; cachePtr.i++) { + refresh_watch_dog(); ptrAss(cachePtr, cacheRecord); cachePtr.p->firstAttrbuf = RNIL; cachePtr.p->lastAttrbuf = RNIL; @@ -9598,6 +9599,7 @@ void Dbtc::initApiConnect(Signal* signal) guard4 = tiacTmp - 1; for (apiConnectptr.i = 0; apiConnectptr.i <= guard4; apiConnectptr.i++) { + refresh_watch_dog(); jam(); ptrAss(apiConnectptr, apiConnectRecord); apiConnectptr.p->apiConnectstate = CS_DISCONNECTED; @@ -9623,6 +9625,7 @@ void Dbtc::initApiConnect(Signal* signal) guard4 = (2 * tiacTmp) - 1; for (apiConnectptr.i = tiacTmp; apiConnectptr.i <= guard4; apiConnectptr.i++) { + refresh_watch_dog(); jam(); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); apiConnectptr.p->apiConnectstate = CS_RESTART; @@ -9648,6 +9651,7 @@ void Dbtc::initApiConnect(Signal* signal) guard4 = (3 * tiacTmp) - 1; for (apiConnectptr.i = 2 * tiacTmp; apiConnectptr.i <= guard4; apiConnectptr.i++) { + refresh_watch_dog(); jam(); ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord); setApiConTimer(apiConnectptr.i, 0, __LINE__); @@ -9676,6 +9680,7 @@ void Dbtc::initattrbuf(Signal* signal) { ndbrequire(cattrbufFilesize > 0); for (attrbufptr.i = 0; attrbufptr.i < cattrbufFilesize; attrbufptr.i++) { + refresh_watch_dog(); jam(); ptrAss(attrbufptr, attrbufRecord); attrbufptr.p->attrbuf[ZINBUF_NEXT] = attrbufptr.i + 1; /* NEXT ATTRBUF */ @@ -9690,6 +9695,7 @@ void Dbtc::initdatabuf(Signal* signal) { ndbrequire(cdatabufFilesize > 0); for (databufptr.i = 0; databufptr.i < cdatabufFilesize; databufptr.i++) { + refresh_watch_dog(); ptrAss(databufptr, databufRecord); databufptr.p->nextDatabuf = databufptr.i + 1; }//for @@ -9817,6 +9823,7 @@ void Dbtc::initialiseScanrec(Signal* signal) ScanRecordPtr scanptr; ndbrequire(cscanrecFileSize > 0); for (scanptr.i = 0; scanptr.i < cscanrecFileSize; scanptr.i++) { + refresh_watch_dog(); jam(); ptrAss(scanptr, scanRecord); new (scanptr.p) ScanRecord(); @@ -9843,6 +9850,7 @@ void Dbtc::initTable(Signal* signal) ndbrequire(ctabrecFilesize > 0); for (tabptr.i = 0; tabptr.i < ctabrecFilesize; tabptr.i++) { + refresh_watch_dog(); ptrAss(tabptr, tableRecord); tabptr.p->currentSchemaVersion = 0; tabptr.p->storedTable = true; @@ -9859,6 +9867,7 @@ void Dbtc::initialiseTcConnect(Signal* signal) // Place half of tcConnectptr's in cfirstfreeTcConnectFail list Uint32 titcTmp = ctcConnectFilesize / 2; for (tcConnectptr.i = 0; tcConnectptr.i < titcTmp; tcConnectptr.i++) { + refresh_watch_dog(); jam(); ptrAss(tcConnectptr, tcConnectRecord); tcConnectptr.p->tcConnectstate = OS_RESTART; @@ -9874,6 +9883,7 @@ void Dbtc::initialiseTcConnect(Signal* signal) // Place other half in cfirstfreeTcConnect list for (tcConnectptr.i = titcTmp; tcConnectptr.i < ctcConnectFilesize; tcConnectptr.i++) { + refresh_watch_dog(); jam(); ptrAss(tcConnectptr, tcConnectRecord); tcConnectptr.p->tcConnectstate = OS_RESTART; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index 8133f70a803..cba3c62ec03 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -888,6 +888,7 @@ void Dbtup::initializeAttrbufrec() AttrbufrecPtr attrBufPtr; for (attrBufPtr.i = 0; attrBufPtr.i < cnoOfAttrbufrec; attrBufPtr.i++) { + refresh_watch_dog(); ptrAss(attrBufPtr, attrbufrec); attrBufPtr.p->attrbuf[ZBUF_NEXT] = attrBufPtr.i + 1; }//for @@ -944,6 +945,7 @@ void Dbtup::initializeFragrecord() { FragrecordPtr regFragPtr; for (regFragPtr.i = 0; regFragPtr.i < cnoOfFragrec; regFragPtr.i++) { + refresh_watch_dog(); ptrAss(regFragPtr, fragrecord); regFragPtr.p->nextfreefrag = regFragPtr.i + 1; regFragPtr.p->checkpointVersion = RNIL; @@ -982,6 +984,7 @@ void Dbtup::initializeOperationrec() { OperationrecPtr regOpPtr; for (regOpPtr.i = 0; regOpPtr.i < cnoOfOprec; regOpPtr.i++) { + refresh_watch_dog(); ptrAss(regOpPtr, operationrec); regOpPtr.p->firstAttrinbufrec = RNIL; regOpPtr.p->lastAttrinbufrec = RNIL; @@ -1036,6 +1039,7 @@ void Dbtup::initializeTablerec() TablerecPtr regTabPtr; for (regTabPtr.i = 0; regTabPtr.i < cnoOfTablerec; regTabPtr.i++) { ljam(); + refresh_watch_dog(); ptrAss(regTabPtr, tablerec); initTab(regTabPtr.p); }//for @@ -1099,6 +1103,7 @@ void Dbtup::initializeTabDescr() cfreeTdList[i] = RNIL; }//for for (regTabDesPtr.i = 0; regTabDesPtr.i < cnoOfTabDescrRec; regTabDesPtr.i++) { + refresh_watch_dog(); ptrAss(regTabDesPtr, tableDescriptor); regTabDesPtr.p->tabDescr = RNIL; }//for @@ -1111,6 +1116,7 @@ void Dbtup::initializeUndoPage() for (undoPagep.i = 0; undoPagep.i < cnoOfUndoPage; undoPagep.i = undoPagep.i + ZUB_SEGMENT_SIZE) { + refresh_watch_dog(); ptrAss(undoPagep, undoPage); undoPagep.p->undoPageWord[ZPAGE_NEXT_POS] = undoPagep.i + ZUB_SEGMENT_SIZE; diff --git a/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp b/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp index d168a6797bb..1830b4135e3 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupPagMan.cpp @@ -123,6 +123,7 @@ void Dbtup::initializePage() PagePtr pagePtr; for (pagePtr.i = 0; pagePtr.i < cnoOfPage; pagePtr.i++) { ljam(); + refresh_watch_dog(); ptrAss(pagePtr, page); pagePtr.p->pageWord[ZPAGE_PHYSICAL_INDEX] = pagePtr.i; pagePtr.p->pageWord[ZPAGE_NEXT_POS] = pagePtr.i + 1; diff --git a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp index 22b2ce69838..f6f1610c8c1 100644 --- a/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp +++ b/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp @@ -192,6 +192,7 @@ Dbtux::execREAD_CONFIG_REQ(Signal* signal) IndexPtr indexPtr; while (1) { jam(); + refresh_watch_dog(); c_indexPool.seize(indexPtr); if (indexPtr.i == RNIL) { jam(); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 91776cd7c03..4b2fcfe0c8c 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -554,11 +554,13 @@ Ndbcntr::execCNTR_START_REP(Signal* signal){ } if(cmasterNodeId != getOwnNodeId()){ + jam(); c_start.reset(); return; } if(c_start.m_waiting.isclear()){ + jam(); c_start.reset(); return; } @@ -597,6 +599,7 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){ ndbrequire(false); case NodeState::SL_STARTING: case NodeState::SL_STARTED: + jam(); break; case NodeState::SL_STOPPING_1: @@ -616,9 +619,11 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){ c_start.m_waiting.set(nodeId); switch(st){ case NodeState::ST_INITIAL_START: + jam(); c_start.m_withoutLog.set(nodeId); break; case NodeState::ST_SYSTEM_RESTART: + jam(); c_start.m_withLog.set(nodeId); if(starting && lastGci > c_start.m_lastGci){ jam(); @@ -631,6 +636,7 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){ return; } if(starting){ + jam(); Uint32 i = c_start.m_logNodesCount++; c_start.m_logNodes[i].m_nodeId = nodeId; c_start.m_logNodes[i].m_lastGci = req->lastGci; @@ -652,11 +658,12 @@ Ndbcntr::execCNTR_START_REQ(Signal * signal){ } if(starting){ + jam(); trySystemRestart(signal); } else { + jam(); startWaitingNodes(signal); } - return; } @@ -670,6 +677,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){ NodeState::StartType nrType = NodeState::ST_NODE_RESTART; if(c_start.m_withoutLog.get(nodeId)){ + jam(); nrType = NodeState::ST_INITIAL_NODE_RESTART; } @@ -706,6 +714,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){ char buf[100]; if(!c_start.m_withLog.isclear()){ + jam(); ndbout_c("Starting nodes w/ log: %s", c_start.m_withLog.getText(buf)); NodeReceiverGroup rg(NDBCNTR, c_start.m_withLog); @@ -716,6 +725,7 @@ Ndbcntr::startWaitingNodes(Signal * signal){ } if(!c_start.m_withoutLog.isclear()){ + jam(); ndbout_c("Starting nodes wo/ log: %s", c_start.m_withoutLog.getText(buf)); NodeReceiverGroup rg(NDBCNTR, c_start.m_withoutLog); conf->startType = NodeState::ST_INITIAL_NODE_RESTART; @@ -777,6 +787,7 @@ Ndbcntr::trySystemRestart(Signal* signal){ jam(); return false; } + jam(); srType = NodeState::ST_INITIAL_START; c_start.m_starting = c_start.m_withoutLog; // Used for starting... c_start.m_withoutLog.clear(); @@ -793,13 +804,11 @@ Ndbcntr::trySystemRestart(Signal* signal){ // If we lose with all nodes, then we're in trouble ndbrequire(!allNodes); return false; - break; case CheckNodeGroups::Partitioning: jam(); bool allowPartition = (c_start.m_startPartitionedTimeout != (Uint64)~0); if(allNodes){ - jam(); if(allowPartition){ jam(); break; @@ -1043,8 +1052,10 @@ void Ndbcntr::ph5ALab(Signal* signal) return; case NodeState::ST_NODE_RESTART: case NodeState::ST_INITIAL_NODE_RESTART: + jam(); break; case NodeState::ST_ILLEGAL_TYPE: + jam(); break; } ndbrequire(false); diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 30f4d783c81..6017365a463 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -258,7 +258,6 @@ void Qmgr::execCONNECT_REP(Signal* signal) { const Uint32 nodeId = signal->theData[0]; c_connectedNodes.set(nodeId); - NodeRecPtr nodePtr; nodePtr.i = getOwnNodeId(); ptrCheckGuard(nodePtr, MAX_NODES, nodeRec); @@ -679,7 +678,6 @@ void Qmgr::execCM_REGREF(Signal* signal) UintR TaddNodeno = signal->theData[1]; UintR TrefuseReason = signal->theData[2]; Uint32 candidate = signal->theData[3]; - DEBUG_START3(signal, TrefuseReason); if(candidate != cpresidentCandidate){ @@ -768,7 +766,6 @@ void Qmgr::execCM_REGREF(Signal* signal) Uint64 now = NdbTick_CurrentMillisecond(); if((c_regReqReqRecv == cnoOfNodes) || now > c_stopElectionTime){ jam(); - electionWon(); sendSttorryLab(signal); diff --git a/ndb/src/kernel/vm/SimulatedBlock.cpp b/ndb/src/kernel/vm/SimulatedBlock.cpp index cb3c5dc9d2c..5546338e6f3 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.cpp +++ b/ndb/src/kernel/vm/SimulatedBlock.cpp @@ -641,7 +641,7 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n) const void* p = NULL; size_t size = n*s; - + refresh_watch_dog(); if (size > 0){ #ifdef VM_TRACE_MEM ndbout_c("%s::allocRecord(%s, %u, %u) = %u bytes", @@ -660,8 +660,7 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n) const snprintf(buf2, sizeof(buf2), "Requested: %ux%u = %u bytes", (Uint32)s, (Uint32)n, (Uint32)size); ERROR_SET(fatal, ERR_MEMALLOC, buf1, buf2); } - - +#ifdef NDB_DEBUG_FULL // Set the allocated memory to zero #ifndef NDB_PURIFY #if defined NDB_OSE @@ -685,6 +684,7 @@ SimulatedBlock::allocRecord(const char * type, size_t s, size_t n) const memset(p, 0xF1, size); #endif +#endif #endif } return p; @@ -703,6 +703,12 @@ SimulatedBlock::deallocRecord(void ** ptr, } } +void +SimulatedBlock::refresh_watch_dog() +{ + globalData.incrementWatchDogCounter(1); +} + void SimulatedBlock::progError(int line, int err_code, const char* extra) const { jamLine(line); diff --git a/ndb/src/kernel/vm/SimulatedBlock.hpp b/ndb/src/kernel/vm/SimulatedBlock.hpp index e3eac8c0e20..164209b2edf 100644 --- a/ndb/src/kernel/vm/SimulatedBlock.hpp +++ b/ndb/src/kernel/vm/SimulatedBlock.hpp @@ -304,7 +304,13 @@ protected: BlockNumber number() const; BlockReference reference() const; NodeId getOwnNodeId() const; - + + /** + * Refresh Watch Dog in initialising code + * + */ + void refresh_watch_dog(); + /** * Prog error * This function should be called when this node should be shutdown