From a3dc06a87413689c5e5f1a623f30317341a41e6e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 9 Feb 2007 13:31:51 +0000 Subject: [PATCH 01/20] BUG#22025 Return correct error message when transporter error occur. ndb/src/common/debugger/EventLogger.cpp: Add correct error string when transporter error occur. --- ndb/src/common/debugger/EventLogger.cpp | 99 ++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 4 deletions(-) diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 3efd52808e2..39daa3effe8 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -16,6 +16,7 @@ #include #include "EventLogger.hpp" +#include #include #include @@ -528,10 +529,100 @@ void getTextUndoLogBlocked(QQQQ) { theData[2]); } void getTextTransporterError(QQQQ) { - BaseString::snprintf(m_text, m_text_len, - "Transporter to node %d reported error 0x%x", - theData[1], - theData[2]); + struct myTransporterError{ + int errorNum; + char errorString[256]; + }; + int i = 0; + int lenth = 0; + static const struct myTransporterError TransporterErrorString[]= + { + //TE_NO_ERROR = 0 + {TE_NO_ERROR,"No error"}, + //TE_ERROR_CLOSING_SOCKET = 0x1 + {TE_ERROR_CLOSING_SOCKET,"Error found during closing of socket"}, + //TE_ERROR_IN_SELECT_BEFORE_ACCEPT = 0x2 + {TE_ERROR_IN_SELECT_BEFORE_ACCEPT,"Error found before accept. The transporter will retry"}, + //TE_INVALID_MESSAGE_LENGTH = 0x3 | TE_DO_DISCONNECT + {TE_INVALID_MESSAGE_LENGTH,"Error found in message (invalid message length)"}, + //TE_INVALID_CHECKSUM = 0x4 | TE_DO_DISCONNECT + {TE_INVALID_CHECKSUM,"Error found in message (checksum)"}, + //TE_COULD_NOT_CREATE_SOCKET = 0x5 + {TE_COULD_NOT_CREATE_SOCKET,"Error found while creating socket(can't create socket)"}, + //TE_COULD_NOT_BIND_SOCKET = 0x6 + {TE_COULD_NOT_BIND_SOCKET,"Error found while binding server socket"}, + //TE_LISTEN_FAILED = 0x7 + {TE_LISTEN_FAILED,"Error found while listening to server socket"}, + //TE_ACCEPT_RETURN_ERROR = 0x8 + {TE_ACCEPT_RETURN_ERROR,"Error found during accept(accept return error)"}, + //TE_SHM_DISCONNECT = 0xb | TE_DO_DISCONNECT + {TE_SHM_DISCONNECT,"The remote node has disconnected"}, + //TE_SHM_IPC_STAT = 0xc | TE_DO_DISCONNECT + {TE_SHM_IPC_STAT,"Unable to check shm segment"}, + //TE_SHM_UNABLE_TO_CREATE_SEGMENT = 0xd + {TE_SHM_UNABLE_TO_CREATE_SEGMENT,"Unable to create shm segment"}, + //TE_SHM_UNABLE_TO_ATTACH_SEGMENT = 0xe + {TE_SHM_UNABLE_TO_ATTACH_SEGMENT,"Unable to attach shm segment"}, + //TE_SHM_UNABLE_TO_REMOVE_SEGMENT = 0xf + {TE_SHM_UNABLE_TO_REMOVE_SEGMENT,"Unable to remove shm segment"}, + //TE_TOO_SMALL_SIGID = 0x10 + {TE_TOO_SMALL_SIGID,"Sig ID too small"}, + //TE_TOO_LARGE_SIGID = 0x11 + {TE_TOO_LARGE_SIGID,"Sig ID too large"}, + //TE_WAIT_STACK_FULL = 0x12 | TE_DO_DISCONNECT + {TE_WAIT_STACK_FULL,"Wait stack was full"}, + //TE_RECEIVE_BUFFER_FULL = 0x13 | TE_DO_DISCONNECT + {TE_RECEIVE_BUFFER_FULL,"Receive buffer was full"}, + //TE_SIGNAL_LOST_SEND_BUFFER_FULL = 0x14 | TE_DO_DISCONNECT + {TE_SIGNAL_LOST_SEND_BUFFER_FULL,"Send buffer was full,and trying to force send fails"}, + //TE_SIGNAL_LOST = 0x15 + {TE_SIGNAL_LOST,"Send failed for unknown reason(signal lost)"}, + //TE_SEND_BUFFER_FULL = 0x16 + {TE_SEND_BUFFER_FULL,"The send buffer was full, but sleeping for a while solved"}, + //TE_SCI_LINK_ERROR = 0x0017 + {TE_SCI_LINK_ERROR,"There is no link from this node to the switch"}, + //TE_SCI_UNABLE_TO_START_SEQUENCE = 0x18 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_START_SEQUENCE,"Could not start a sequence, because system resources are exumed or no sequence has been created"}, + //TE_SCI_UNABLE_TO_REMOVE_SEQUENCE = 0x19 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_REMOVE_SEQUENCE,"Could not remove a sequence"}, + //TE_SCI_UNABLE_TO_CREATE_SEQUENCE = 0x1a | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_CREATE_SEQUENCE,"Could not create a sequence, because system resources are exempted. Must reboot"}, + //TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR = 0x1b | TE_DO_DISCONNECT + {TE_SCI_UNRECOVERABLE_DATA_TFX_ERROR,"Tried to send data on redundant link but failed"}, + //TE_SCI_CANNOT_INIT_LOCALSEGMENT = 0x1c | TE_DO_DISCONNECT + {TE_SCI_CANNOT_INIT_LOCALSEGMENT,"Cannot initialize local segment"}, + //TE_SCI_CANNOT_MAP_REMOTESEGMENT = 0x1d | TE_DO_DISCONNEC + {TE_SCI_CANNOT_MAP_REMOTESEGMENT,"Cannot map remote segment"}, + //TE_SCI_UNABLE_TO_UNMAP_SEGMENT = 0x1e | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_UNMAP_SEGMENT,"Cannot free the resources used by this segment (step 1)"}, + //TE_SCI_UNABLE_TO_REMOVE_SEGMENT = 0x1f | TE_DO_DISCONNEC + {TE_SCI_UNABLE_TO_REMOVE_SEGMENT,"Cannot free the resources used by this segment (step 2)"}, + //TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT = 0x20 | TE_DO_DISCONNECT + {TE_SCI_UNABLE_TO_DISCONNECT_SEGMENT,"Cannot disconnect from a remote segment"}, + //TE_SHM_IPC_PERMANENT = 0x21 + {TE_SHM_IPC_PERMANENT,"Shm ipc Permanent error"}, + //TE_SCI_UNABLE_TO_CLOSE_CHANNEL = 0x22 + {TE_SCI_UNABLE_TO_CLOSE_CHANNEL,"Unable to close the sci channel and the resources allocated"} + }; + + lenth = sizeof(TransporterErrorString)/sizeof(struct myTransporterError); + for(i=0; i Date: Wed, 14 Feb 2007 11:05:38 +0700 Subject: [PATCH 02/20] Bug#26293 cluster mgmt node sometimes doesn't receive events from all nodes on restart - signals where sometimes sent too early when setting up subscriptions ndb/include/kernel/signaldata/DumpStateOrd.hpp: added dump for active subscriptions in cmvmi ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: added dump for active subscriptions in cmvmi ndb/src/mgmsrv/MgmtSrvr.cpp: bug in that signals where sent prior to api reg conf arrived, causing thrown away signals and subsequent hangs in mgmtserver also add retry if node connected but not yet received api reg conf ndb/src/ndbapi/ClusterMgr.cpp: added status variable m_api_reg_conf in cluster manager to correctly be able to determine if a node is sendable ndb/src/ndbapi/ClusterMgr.hpp: added status variable m_api_reg_conf in cluster manager to correctly be able to determine if a node is sendable ndb/src/ndbapi/SignalSender.cpp: assert to see that node is sendable when signal is sent ndb/src/ndbapi/SignalSender.hpp: manke metchd const --- .../kernel/signaldata/DumpStateOrd.hpp | 4 + ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 20 +++- ndb/src/mgmsrv/MgmtSrvr.cpp | 94 +++++++++++++++---- ndb/src/ndbapi/ClusterMgr.cpp | 5 +- ndb/src/ndbapi/ClusterMgr.hpp | 1 + ndb/src/ndbapi/SignalSender.cpp | 2 + ndb/src/ndbapi/SignalSender.hpp | 2 +- 7 files changed, 105 insertions(+), 23 deletions(-) diff --git a/ndb/include/kernel/signaldata/DumpStateOrd.hpp b/ndb/include/kernel/signaldata/DumpStateOrd.hpp index 8d0961d1c27..5a1d9ece9cf 100644 --- a/ndb/include/kernel/signaldata/DumpStateOrd.hpp +++ b/ndb/include/kernel/signaldata/DumpStateOrd.hpp @@ -107,6 +107,10 @@ public: CmvmiDumpLongSignalMemory = 2601, CmvmiSetRestartOnErrorInsert = 2602, CmvmiTestLongSigWithDelay = 2603, + CmvmiDumpSubscriptions = 2604, /* note: done to respective outfile + to be able to debug if events + for some reason does not end up + in clusterlog */ // 7000 DIH // 7001 DIH // 7002 DIH diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 5dd1e527dd2..a9d9c991ca3 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -897,7 +897,7 @@ void Cmvmi::execSET_VAR_REQ(Signal* signal) case TimeToWaitAlive: // QMGR - case HeartbeatIntervalDbDb: // TODO ev till Ndbcnt också + case HeartbeatIntervalDbDb: // TODO possibly Ndbcnt too case HeartbeatIntervalDbApi: case ArbitTimeout: sendSignal(QMGR_REF, GSN_SET_VAR_REQ, signal, 3, JBB); @@ -1105,6 +1105,24 @@ Cmvmi::execDUMP_STATE_ORD(Signal* signal) } } + if (arg == DumpStateOrd::CmvmiDumpSubscriptions) + { + SubscriberPtr ptr; + subscribers.first(ptr); + g_eventLogger.info("List subscriptions:"); + while(ptr.i != RNIL) + { + g_eventLogger.info("Subscription: %u, nodeId: %u, ref: 0x%x", + ptr.i, refToNode(ptr.p->blockRef), ptr.p->blockRef); + for(Uint32 i = 0; i < LogLevel::LOGLEVEL_CATEGORIES; i++) + { + Uint32 level = ptr.p->logLevel.getLogLevel((LogLevel::EventCategory)i); + g_eventLogger.info("Category %u Level %u", i, level); + } + subscribers.next(ptr); + } + } + if (arg == DumpStateOrd::CmvmiDumpLongSignalMemory){ infoEvent("Cmvmi: g_sectionSegmentPool size: %d free: %d", g_sectionSegmentPool.getSize(), diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 0ee59f70885..5818e7fe3ae 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -704,7 +704,7 @@ int MgmtSrvr::okToSendTo(NodeId nodeId, bool unCond) return WRONG_PROCESS_TYPE; // Check if we have contact with it if(unCond){ - if(theFacade->theClusterMgr->getNodeInfo(nodeId).connected) + if(theFacade->theClusterMgr->getNodeInfo(nodeId).m_api_reg_conf) return 0; } else if (theFacade->get_node_alive(nodeId) == true) @@ -1562,32 +1562,85 @@ MgmtSrvr::status(int nodeId, } int -MgmtSrvr::setEventReportingLevelImpl(int nodeId, +MgmtSrvr::setEventReportingLevelImpl(int nodeId_arg, const EventSubscribeReq& ll) { SignalSender ss(theFacade); - ss.lock(); - - SimpleSignal ssig; - EventSubscribeReq * dst = - CAST_PTR(EventSubscribeReq, ssig.getDataPtrSend()); - ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, - EventSubscribeReq::SignalLength); - *dst = ll; - - NodeBitmask nodes; + NdbNodeBitmask nodes; + int retries = 30; nodes.clear(); - Uint32 max = (nodeId == 0) ? (nodeId = 1, MAX_NDB_NODES) : nodeId; - for(; (Uint32) nodeId <= max; nodeId++) + while (1) { - if (nodeTypes[nodeId] != NODE_TYPE_DB) - continue; - if (okToSendTo(nodeId, true)) - continue; - if (ss.sendSignal(nodeId, &ssig) == SEND_OK) + Uint32 nodeId, max; + ss.lock(); + SimpleSignal ssig; + EventSubscribeReq * dst = + CAST_PTR(EventSubscribeReq, ssig.getDataPtrSend()); + ssig.set(ss,TestOrd::TraceAPI, CMVMI, GSN_EVENT_SUBSCRIBE_REQ, + EventSubscribeReq::SignalLength); + *dst = ll; + + if (nodeId_arg == 0) { - nodes.set(nodeId); + // all nodes + nodeId = 1; + max = MAX_NDB_NODES; } + else + { + // only one node + max = nodeId = nodeId_arg; + } + // first make sure nodes are sendable + for(; nodeId <= max; nodeId++) + { + if (nodeTypes[nodeId] != NODE_TYPE_DB) + continue; + if (okToSendTo(nodeId, true)) + { + if (theFacade->theClusterMgr->getNodeInfo(nodeId).connected == false) + { + // node not connected we can safely skip this one + continue; + } + // api_reg_conf not recevied yet, need to retry + break; + } + } + if (nodeId <= max) + { + if (--retries) + { + ss.unlock(); + NdbSleep_MilliSleep(100); + continue; + } + return SEND_OR_RECEIVE_FAILED; + } + + if (nodeId_arg == 0) + { + // all nodes + nodeId = 1; + max = MAX_NDB_NODES; + } + else + { + // only one node + max = nodeId = nodeId_arg; + } + // now send to all sendable nodes nodes + // note, lock is held, so states have not changed + for(; (Uint32) nodeId <= max; nodeId++) + { + if (nodeTypes[nodeId] != NODE_TYPE_DB) + continue; + if (theFacade->theClusterMgr->getNodeInfo(nodeId).connected == false) + continue; // node is not connected, skip + if (ss.sendSignal(nodeId, &ssig) == SEND_OK) + nodes.set(nodeId); + } + break; } if (nodes.isclear()) @@ -1598,6 +1651,7 @@ MgmtSrvr::setEventReportingLevelImpl(int nodeId, int error = 0; while (!nodes.isclear()) { + Uint32 nodeId; SimpleSignal *signal = ss.waitFor(); int gsn = signal->readSignalNumber(); nodeId = refToNode(signal->header.theSendersBlockRef); diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 2ff27ca893e..060e5f71b6c 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -327,7 +327,7 @@ ClusterMgr::showState(NodeId nodeId){ ClusterMgr::Node::Node() : m_state(NodeState::SL_NOTHING) { compatible = nfCompleteRep = true; - connected = defined = m_alive = false; + connected = defined = m_alive = m_api_reg_conf = false; m_state.m_connected_nodes.clear(); } @@ -401,6 +401,8 @@ ClusterMgr::execAPI_REGCONF(const Uint32 * theData){ node.m_info.m_version); } + node.m_api_reg_conf = true; + node.m_state = apiRegConf->nodeState; if (node.compatible && (node.m_state.startLevel == NodeState::SL_STARTED || node.m_state.startLevel == NodeState::SL_SINGLEUSER)){ @@ -519,6 +521,7 @@ ClusterMgr::reportDisconnected(NodeId nodeId){ noOfConnectedNodes--; theNodes[nodeId].connected = false; + theNodes[nodeId].m_api_reg_conf = false; theNodes[nodeId].m_state.m_connected_nodes.clear(); reportNodeFailed(nodeId, true); diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp index 32234a0b2f4..b05b73c8324 100644 --- a/ndb/src/ndbapi/ClusterMgr.hpp +++ b/ndb/src/ndbapi/ClusterMgr.hpp @@ -65,6 +65,7 @@ public: bool compatible; // Version is compatible bool nfCompleteRep; // NF Complete Rep has arrived bool m_alive; // Node is alive + bool m_api_reg_conf;// API_REGCONF has arrived NodeInfo m_info; NodeState m_state; diff --git a/ndb/src/ndbapi/SignalSender.cpp b/ndb/src/ndbapi/SignalSender.cpp index 804ea92877d..199c6d6e804 100644 --- a/ndb/src/ndbapi/SignalSender.cpp +++ b/ndb/src/ndbapi/SignalSender.cpp @@ -140,6 +140,8 @@ SignalSender::getNoOfConnectedNodes() const { SendStatus SignalSender::sendSignal(Uint16 nodeId, const SimpleSignal * s){ + assert(getNodeInfo(nodeId).m_api_reg_conf == true || + s->readSignalNumber() == GSN_API_REGREQ); return theFacade->theTransporterRegistry->prepareSend(&s->header, 1, // JBB &s->theData[0], diff --git a/ndb/src/ndbapi/SignalSender.hpp b/ndb/src/ndbapi/SignalSender.hpp index ec874e63c52..4cad759a334 100644 --- a/ndb/src/ndbapi/SignalSender.hpp +++ b/ndb/src/ndbapi/SignalSender.hpp @@ -32,7 +32,7 @@ public: Uint32 theData[25]; LinearSectionPtr ptr[3]; - int readSignalNumber() {return header.theVerId_signalNumber; } + int readSignalNumber() const {return header.theVerId_signalNumber; } Uint32 *getDataPtrSend() { return theData; } const Uint32 *getDataPtr() const { return theData; } From 00b143b439a9ae00ba6653c399f4a6da718626d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 11:16:10 +0700 Subject: [PATCH 03/20] make sure some printouts in ndbd out file is done with g_eventLogger --- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 130 +++++++++++----------- ndb/src/kernel/vm/WatchDog.cpp | 7 +- 2 files changed, 71 insertions(+), 66 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 5ee3ac8d67d..7810aa45d00 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -1786,8 +1786,8 @@ void Dbdih::execSTART_PERMREQ(Signal* signal) return; }//if if (getNodeStatus(nodeId) != NodeRecord::DEAD){ - ndbout << "nodeStatus in START_PERMREQ = " - << (Uint32) getNodeStatus(nodeId) << endl; + g_eventLogger.error("nodeStatus in START_PERMREQ = %u", + (Uint32) getNodeStatus(nodeId)); ndbrequire(false); }//if @@ -4029,9 +4029,9 @@ void Dbdih::checkCopyTab(NodeRecordPtr failedNodePtr) jam(); break; default: - ndbout_c("outstanding gsn: %s(%d)", - getSignalName(c_nodeStartMaster.m_outstandingGsn), - c_nodeStartMaster.m_outstandingGsn); + g_eventLogger.error("outstanding gsn: %s(%d)", + getSignalName(c_nodeStartMaster.m_outstandingGsn), + c_nodeStartMaster.m_outstandingGsn); ndbrequire(false); } @@ -4472,9 +4472,10 @@ void Dbdih::failedNodeLcpHandling(Signal* signal, NodeRecordPtr failedNodePtr) failedNodePtr.p->activeStatus = Sysfile::NS_NotActive_NotTakenOver; break; default: - ndbout << "activeStatus = " << (Uint32) failedNodePtr.p->activeStatus; - ndbout << " at failure after NODE_FAILREP of node = "; - ndbout << failedNodePtr.i << endl; + g_eventLogger.error("activeStatus = %u " + "at failure after NODE_FAILREP of node = %u", + (Uint32) failedNodePtr.p->activeStatus, + failedNodePtr.i); ndbrequire(false); break; }//switch @@ -4629,7 +4630,7 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){ /** * Node failure during master take over... */ - ndbout_c("Nodefail during master take over"); + g_eventLogger.info("Nodefail during master take over"); } setLocalNodefailHandling(signal, nodeId, NF_LCP_TAKE_OVER); @@ -4869,7 +4870,8 @@ void Dbdih::execMASTER_GCPCONF(Signal* signal) if (latestLcpId > SYSFILE->latestLCP_ID) { jam(); #if 0 - ndbout_c("Dbdih: Setting SYSFILE->latestLCP_ID to %d", latestLcpId); + g_eventLogger.info("Dbdih: Setting SYSFILE->latestLCP_ID to %d", + latestLcpId); SYSFILE->latestLCP_ID = latestLcpId; #endif SYSFILE->keepGCI = oldestKeepGci; @@ -5528,7 +5530,7 @@ Dbdih::checkLocalNodefailComplete(Signal* signal, Uint32 failedNodeId, if (ERROR_INSERTED(7030)) { - ndbout_c("Reenable GCP_PREPARE"); + g_eventLogger.info("Reenable GCP_PREPARE"); CLEAR_ERROR_INSERT_VALUE; } @@ -5701,7 +5703,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signal){ c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__); #if 0 if(c_copyGCISlave.m_copyReason == CopyGCIReq::LOCAL_CHECKPOINT){ - ndbout_c("Dbdih: Also resetting c_copyGCISlave"); + g_eventLogger.info("Dbdih: Also resetting c_copyGCISlave"); c_copyGCISlave.m_copyReason = CopyGCIReq::IDLE; c_copyGCISlave.m_expectedNextWord = 0; } @@ -5790,7 +5792,7 @@ Dbdih::sendMASTER_LCPCONF(Signal * signal){ if(c_lcpState.lcpStatus == LCP_TAB_SAVED){ #ifdef VM_TRACE - ndbout_c("Sending extra GSN_LCP_COMPLETE_REP to new master"); + g_eventLogger.info("Sending extra GSN_LCP_COMPLETE_REP to new master"); #endif sendLCP_COMPLETE_REP(signal); } @@ -5946,7 +5948,7 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal) nodePtr.p->lcpStateAtTakeOver = lcpState; #ifdef VM_TRACE - ndbout_c("MASTER_LCPCONF"); + g_eventLogger.info("MASTER_LCPCONF"); printMASTER_LCP_CONF(stdout, &signal->theData[0], 0, 0); #endif @@ -6023,7 +6025,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) // protocol. /* --------------------------------------------------------------------- */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart"); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_IDLE -> checkLcpStart"); #endif checkLcpStart(signal, __LINE__); break; @@ -6034,7 +6036,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) // protocol by calculating the keep gci and storing the new lcp id. /* --------------------------------------------------------------------- */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId"); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_COPY_ONGOING -> storeNewLcpId"); #endif if (c_lcpState.lcpStatus == LCP_STATUS_ACTIVE) { jam(); @@ -6045,7 +6047,7 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) /*---------------------------------------------------------------------*/ Uint32 lcpId = SYSFILE->latestLCP_ID; #ifdef VM_TRACE - ndbout_c("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1); + g_eventLogger.info("Decreasing latestLCP_ID from %d to %d", lcpId, lcpId - 1); #endif SYSFILE->latestLCP_ID--; }//if @@ -6062,10 +6064,10 @@ void Dbdih::MASTER_LCPhandling(Signal* signal, Uint32 failedNodeId) * complete before finalising the LCP process. * ------------------------------------------------------------------ */ #ifdef VM_TRACE - ndbout_c("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> " - "startLcpRoundLoopLab(table=%u, fragment=%u)", - c_lcpMasterTakeOverState.minTableId, - c_lcpMasterTakeOverState.minFragId); + g_eventLogger.info("MASTER_LCPhandling:: LMTOS_ALL_ACTIVE -> " + "startLcpRoundLoopLab(table=%u, fragment=%u)", + c_lcpMasterTakeOverState.minTableId, + c_lcpMasterTakeOverState.minFragId); #endif c_lcpState.keepGci = SYSFILE->keepGCI; @@ -7376,8 +7378,8 @@ void Dbdih::checkGcpStopLab(Signal* signal) if (cgcpSameCounter == 1200) { jam(); #ifdef VM_TRACE - ndbout << "System crash due to GCP Stop in state = "; - ndbout << (Uint32) cgcpStatus << endl; + g_eventLogger.error("System crash due to GCP Stop in state = %u", + (Uint32) cgcpStatus); #endif crashSystemAtGcpStop(signal); return; @@ -7390,8 +7392,8 @@ void Dbdih::checkGcpStopLab(Signal* signal) if (cgcpSameCounter == 1200) { jam(); #ifdef VM_TRACE - ndbout << "System crash due to GCP Stop in state = "; - ndbout << (Uint32) cgcpStatus << endl; + g_eventLogger.error("System crash due to GCP Stop in state = %u", + (Uint32) cgcpStatus); #endif crashSystemAtGcpStop(signal); return; @@ -7582,7 +7584,7 @@ void Dbdih::GCP_SAVEhandling(Signal* signal, Uint32 nodeId) getNodeState().startLevel == NodeState::SL_STARTED){ jam(); #if 0 - ndbout_c("Dbdih: Clearing initial start ongoing"); + g_eventLogger.info("Dbdih: Clearing initial start ongoing"); #endif Sysfile::clearInitialStartOngoing(SYSFILE->systemRestartBits); } @@ -7601,7 +7603,7 @@ void Dbdih::execGCP_PREPARE(Signal* signal) if (ERROR_INSERTED(7030)) { cgckptflag = true; - ndbout_c("Delayed GCP_PREPARE 5s"); + g_eventLogger.info("Delayed GCP_PREPARE 5s"); sendSignalWithDelay(reference(), GSN_GCP_PREPARE, signal, 5000, signal->getLength()); return; @@ -7621,7 +7623,7 @@ void Dbdih::execGCP_PREPARE(Signal* signal) if (ERROR_INSERTED(7031)) { - ndbout_c("Crashing delayed in GCP_PREPARE 3s"); + g_eventLogger.info("Crashing delayed in GCP_PREPARE 3s"); signal->theData[0] = 9999; sendSignalWithDelay(CMVMI_REF, GSN_NDB_TAMPER, signal, 3000, 1); return; @@ -8136,7 +8138,7 @@ void Dbdih::initLcpLab(Signal* signal, Uint32 senderRef, Uint32 tableId) * This is LCP master takeover */ #ifdef VM_TRACE - ndbout_c("initLcpLab aborted due to LCP master takeover - 1"); + g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 1"); #endif c_lcpState.setLcpStatus(LCP_STATUS_IDLE, __LINE__); sendMASTER_LCPCONF(signal); @@ -8149,7 +8151,7 @@ void Dbdih::initLcpLab(Signal* signal, Uint32 senderRef, Uint32 tableId) * Master take over but has not yet received MASTER_LCPREQ */ #ifdef VM_TRACE - ndbout_c("initLcpLab aborted due to LCP master takeover - 2"); + g_eventLogger.info("initLcpLab aborted due to LCP master takeover - 2"); #endif return; } @@ -9380,9 +9382,10 @@ void Dbdih::checkTcCounterLab(Signal* signal) { CRASH_INSERTION(7009); if (c_lcpState.lcpStatus != LCP_STATUS_IDLE) { - ndbout << "lcpStatus = " << (Uint32) c_lcpState.lcpStatus; - ndbout << "lcpStatusUpdatedPlace = " << - c_lcpState.lcpStatusUpdatedPlace << endl; + g_eventLogger.error("lcpStatus = %u" + "lcpStatusUpdatedPlace = %d", + (Uint32) c_lcpState.lcpStatus, + c_lcpState.lcpStatusUpdatedPlace); ndbrequire(false); return; }//if @@ -9935,9 +9938,8 @@ void Dbdih::execLCP_FRAG_REP(Signal* signal) if(tabPtr.p->tabStatus == TabRecord::TS_DROPPING){ jam(); - ndbout_c("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ", - tableId, - fragId); + g_eventLogger.info("TS_DROPPING - Neglecting to save Table: %d Frag: %d - ", + tableId, fragId); } else { jam(); /** @@ -10065,7 +10067,7 @@ void Dbdih::findReplica(ReplicaRecordPtr& replicaPtr, }; #ifdef VM_TRACE - ndbout_c("Fragment Replica(node=%d) not found", nodeId); + g_eventLogger.info("Fragment Replica(node=%d) not found", nodeId); replicaPtr.i = fragPtrP->oldStoredReplicas; while(replicaPtr.i != RNIL){ ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord); @@ -10078,9 +10080,9 @@ void Dbdih::findReplica(ReplicaRecordPtr& replicaPtr, }//if }; if(replicaPtr.i != RNIL){ - ndbout_c("...But was found in oldStoredReplicas"); + g_eventLogger.info("...But was found in oldStoredReplicas"); } else { - ndbout_c("...And wasn't found in oldStoredReplicas"); + g_eventLogger.info("...And wasn't found in oldStoredReplicas"); } #endif ndbrequire(false); @@ -10114,8 +10116,8 @@ Dbdih::reportLcpCompletion(const LcpFragRep* lcpReport) ndbrequire(replicaPtr.p->lcpOngoingFlag == true); if(lcpNo != replicaPtr.p->nextLcp){ - ndbout_c("lcpNo = %d replicaPtr.p->nextLcp = %d", - lcpNo, replicaPtr.p->nextLcp); + g_eventLogger.error("lcpNo = %d replicaPtr.p->nextLcp = %d", + lcpNo, replicaPtr.p->nextLcp); ndbrequire(false); } ndbrequire(lcpNo == replicaPtr.p->nextLcp); @@ -10150,7 +10152,7 @@ Dbdih::reportLcpCompletion(const LcpFragRep* lcpReport) // Not all fragments in table have been checkpointed. /* ----------------------------------------------------------------- */ if(0) - ndbout_c("reportLcpCompletion: fragment %d not ready", fid); + g_eventLogger.info("reportLcpCompletion: fragment %d not ready", fid); return false; }//if }//for @@ -10267,7 +10269,7 @@ void Dbdih::execLCP_COMPLETE_REP(Signal* signal) jamEntry(); #if 0 - ndbout_c("LCP_COMPLETE_REP"); + g_eventLogger.info("LCP_COMPLETE_REP"); printLCP_COMPLETE_REP(stdout, signal->getDataPtr(), signal->length(), number()); @@ -10353,7 +10355,7 @@ void Dbdih::allNodesLcpCompletedLab(Signal* signal) if(c_lcpMasterTakeOverState.state != LMTOS_IDLE){ jam(); #ifdef VM_TRACE - ndbout_c("Exiting from allNodesLcpCompletedLab"); + g_eventLogger.info("Exiting from allNodesLcpCompletedLab"); #endif return; } @@ -10582,14 +10584,14 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal) infoEvent("Detected GCP stop...sending kill to %s", c_GCP_SAVEREQ_Counter.getText()); - ndbout_c("Detected GCP stop...sending kill to %s", - c_GCP_SAVEREQ_Counter.getText()); + g_eventLogger.error("Detected GCP stop...sending kill to %s", + c_GCP_SAVEREQ_Counter.getText()); return; } case GCP_SAVE_LQH_FINISHED: - ndbout_c("m_copyReason: %d m_waiting: %d", - c_copyGCIMaster.m_copyReason, - c_copyGCIMaster.m_waiting); + g_eventLogger.error("m_copyReason: %d m_waiting: %d", + c_copyGCIMaster.m_copyReason, + c_copyGCIMaster.m_waiting); break; case GCP_READY: // shut up lint case GCP_PREPARE_SENT: @@ -10597,11 +10599,11 @@ void Dbdih::crashSystemAtGcpStop(Signal* signal) break; } - ndbout_c("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d", - c_copyGCISlave.m_senderData, - c_copyGCISlave.m_senderRef, - c_copyGCISlave.m_copyReason, - c_copyGCISlave.m_expectedNextWord); + g_eventLogger.error("c_copyGCISlave: sender{Data, Ref} %d %x reason: %d nextWord: %d", + c_copyGCISlave.m_senderData, + c_copyGCISlave.m_senderRef, + c_copyGCISlave.m_copyReason, + c_copyGCISlave.m_expectedNextWord); FileRecordPtr file0Ptr; file0Ptr.i = crestartInfoFile[0]; @@ -12804,9 +12806,9 @@ void Dbdih::setLcpActiveStatusEnd() nodePtr.i = getOwnNodeId(); ptrAss(nodePtr, nodeRecord); ndbrequire(nodePtr.p->activeStatus == Sysfile::NS_Active); - ndbout_c("NR: setLcpActiveStatusEnd - m_participatingLQH"); + g_eventLogger.info("NR: setLcpActiveStatusEnd - m_participatingLQH"); } else { - ndbout_c("NR: setLcpActiveStatusEnd - !m_participatingLQH"); + g_eventLogger.info("NR: setLcpActiveStatusEnd - !m_participatingLQH"); } } @@ -13637,8 +13639,8 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) } if(arg == DumpStateOrd::EnableUndoDelayDataWrite){ - ndbout << "Dbdih:: delay write of datapages for table = " - << dumpState->args[1]<< endl; + g_eventLogger.info("Dbdih:: delay write of datapages for table = %s", + dumpState->args[1]); // Send this dump to ACC and TUP EXECUTE_DIRECT(DBACC, GSN_DUMP_STATE_ORD, signal, 2); EXECUTE_DIRECT(DBTUP, GSN_DUMP_STATE_ORD, signal, 2); @@ -13655,13 +13657,13 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) }//if if (signal->theData[0] == DumpStateOrd::DihMinTimeBetweenLCP) { // Set time between LCP to min value - ndbout << "Set time between LCP to min value" << endl; + g_eventLogger.info("Set time between LCP to min value"); c_lcpState.clcpDelay = 0; // TimeBetweenLocalCheckpoints.min return; } if (signal->theData[0] == DumpStateOrd::DihMaxTimeBetweenLCP) { // Set time between LCP to max value - ndbout << "Set time between LCP to max value" << endl; + g_eventLogger.info("Set time between LCP to max value"); c_lcpState.clcpDelay = 31; // TimeBetweenLocalCheckpoints.max return; } @@ -13697,7 +13699,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal) { cgcpDelay = signal->theData[1]; } - ndbout_c("Setting time between gcp : %d", cgcpDelay); + g_eventLogger.info("Setting time between gcp : %d", cgcpDelay); } if (arg == 7021 && signal->getLength() == 2) @@ -13820,7 +13822,7 @@ Dbdih::execPREP_DROP_TAB_REQ(Signal* signal){ while(index < count){ if(nodePtr.p->queuedChkpt[index].tableId == tabPtr.i){ jam(); - // ndbout_c("Unqueuing %d", index); + // g_eventLogger.info("Unqueuing %d", index); count--; for(Uint32 i = index; i #include #include - +#include + +extern EventLogger g_eventLogger; + extern "C" void* runWatchDog(void* w){ @@ -125,7 +128,7 @@ WatchDog::run(){ last_stuck_action = "Unknown place"; break; }//switch - ndbout << "Ndb kernel is stuck in: " << last_stuck_action << endl; + g_eventLogger.warning("Ndb kernel is stuck in: %s", last_stuck_action); if(alerts == 3){ shutdownSystem(last_stuck_action); } From 7fd6bbce2538f30fa2a2a76da44117e28e5c7a57 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:22:03 +1100 Subject: [PATCH 04/20] WL#3704 mgmapi timeouts (and cleanups) indicate units in SocketOutputStream timeout rename timeout in SocketOutputStream to reflect units (ms) In 5.0 as well as is safe cleanup patch that will help with merging. ndb/include/util/OutputStream.hpp: rename timeout in SocketOutputStream to reflect units (ms) ndb/src/common/util/OutputStream.cpp: rename timeout in SocketOutputStream to reflect units (ms) --- ndb/include/util/OutputStream.hpp | 6 +++--- ndb/src/common/util/OutputStream.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ndb/include/util/OutputStream.hpp b/ndb/include/util/OutputStream.hpp index 460915e12e7..35ef3c5fed4 100644 --- a/ndb/include/util/OutputStream.hpp +++ b/ndb/include/util/OutputStream.hpp @@ -42,10 +42,10 @@ public: class SocketOutputStream : public OutputStream { NDB_SOCKET_TYPE m_socket; - unsigned m_timeout; + unsigned m_timeout_ms; public: - SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned writeTimeout = 1000); - + SocketOutputStream(NDB_SOCKET_TYPE socket, unsigned write_timeout_ms = 1000); + int print(const char * fmt, ...); int println(const char * fmt, ...); }; diff --git a/ndb/src/common/util/OutputStream.cpp b/ndb/src/common/util/OutputStream.cpp index cccd76eac2c..eada1452f02 100644 --- a/ndb/src/common/util/OutputStream.cpp +++ b/ndb/src/common/util/OutputStream.cpp @@ -42,16 +42,16 @@ FileOutputStream::println(const char * fmt, ...){ } SocketOutputStream::SocketOutputStream(NDB_SOCKET_TYPE socket, - unsigned timeout){ + unsigned write_timeout_ms){ m_socket = socket; - m_timeout = timeout; + m_timeout_ms = write_timeout_ms; } int SocketOutputStream::print(const char * fmt, ...){ va_list ap; va_start(ap, fmt); - const int ret = vprint_socket(m_socket, m_timeout, fmt, ap); + const int ret = vprint_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); return ret; } @@ -59,7 +59,7 @@ int SocketOutputStream::println(const char * fmt, ...){ va_list ap; va_start(ap, fmt); - const int ret = vprintln_socket(m_socket, m_timeout, fmt, ap); + const int ret = vprintln_socket(m_socket, m_timeout_ms, fmt, ap); va_end(ap); return ret; } From 22d157e494bc271b001b304509ac67d13eec10af Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:28:04 +1100 Subject: [PATCH 05/20] BUG#26352 unused ndb_mgm_rep_command in mgmapi.cpp ndb/src/mgmapi/mgmapi.cpp: remove ndb_mgm_rep_command function --- ndb/src/mgmapi/mgmapi.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/ndb/src/mgmapi/mgmapi.cpp b/ndb/src/mgmapi/mgmapi.cpp index fa7aed8b182..cacb55fe8fc 100644 --- a/ndb/src/mgmapi/mgmapi.cpp +++ b/ndb/src/mgmapi/mgmapi.cpp @@ -2187,43 +2187,6 @@ ndb_mgm_alloc_nodeid(NdbMgmHandle handle, unsigned int version, int nodetype, return nodeid; } -/***************************************************************************** - * Global Replication - ******************************************************************************/ -extern "C" -int -ndb_mgm_rep_command(NdbMgmHandle handle, unsigned int request, - unsigned int* replication_id, - struct ndb_mgm_reply* /*reply*/) -{ - SET_ERROR(handle, NDB_MGM_NO_ERROR, "Executing: ndb_mgm_rep_command"); - const ParserRow replication_reply[] = { - MGM_CMD("global replication reply", NULL, ""), - MGM_ARG("result", String, Mandatory, "Error message"), - MGM_ARG("id", Int, Optional, "Id of global replication"), - MGM_END() - }; - CHECK_HANDLE(handle, -1); - CHECK_CONNECTED(handle, -1); - - Properties args; - args.put("request", request); - const Properties *reply; - reply = ndb_mgm_call(handle, replication_reply, "rep", &args); - CHECK_REPLY(reply, -1); - - const char * result; - reply->get("result", &result); - reply->get("id", replication_id); - if(strcmp(result,"Ok")!=0) { - delete reply; - return -1; - } - - delete reply; - return 0; -} - extern "C" int ndb_mgm_set_int_parameter(NdbMgmHandle handle, From a031b4307cfc78262bc512be27dcc7f2c9a5267f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:35:29 +1100 Subject: [PATCH 06/20] BUG#26353 remove GET_CONFIG_BACKWARDS_COMPAT from ndb_mgmd there is backwards compatibility for GET CONFIG style configuration requests in ndb_mgmd. None of the ndbd versions that use this couldn't possibly connect to a 5.0 or 5.1 cluster. remove the backwards compat remove it ndb/src/mgmsrv/Services.cpp: remove MGM_GET_CONFIG_BACKWARDS_COMPAT code. any client using GET CONFIG will just not work with modern NDB. ndb/src/mgmsrv/Services.hpp: remove GET CONFIG support --- ndb/src/mgmsrv/Services.cpp | 86 ++----------------------------------- ndb/src/mgmsrv/Services.hpp | 9 ---- 2 files changed, 3 insertions(+), 92 deletions(-) diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index a2dec949f67..aa35c826535 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -332,19 +332,6 @@ MgmApiSession::runSession() switch(ctx.m_status) { case Parser_t::UnknownCommand: -#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT - /* Backwards compatibility for old NDBs that still use - * the old "GET CONFIG" command. - */ - size_t i; - for(i=0; iprintln("Expected 2 arguments for GET CONFIG"); - return; - } - - /* Put arguments in properties object so we can call the real function */ - args.put("version", version); - args.put("node", node); - getConfig_common(ctx, args, true); -} -#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ - -void -MgmApiSession::getConfig(Parser_t::Context &ctx, - const class Properties &args) { - getConfig_common(ctx, args); -} - static Properties * backward(const char * base, const Properties* reply){ Properties * ret = new Properties(); @@ -560,9 +521,9 @@ MgmApiSession::get_nodeid(Parser_t::Context &, } void -MgmApiSession::getConfig_common(Parser_t::Context &, - const class Properties &args, - bool compat) { +MgmApiSession::getConfig(Parser_t::Context &, + const class Properties &args) +{ Uint32 version, node = 0; args.get("version", &version); @@ -576,47 +537,6 @@ MgmApiSession::getConfig_common(Parser_t::Context &, return; } - if(version > 0 && version < makeVersion(3, 5, 0) && compat){ - Properties *reply = backward("", conf->m_oldConfig); - reply->put("Version", version); - reply->put("LocalNodeId", node); - - backward("", reply); - //reply->print(); - - const Uint32 size = reply->getPackedSize(); - Uint32 *buffer = new Uint32[size/4+1]; - - reply->pack(buffer); - delete reply; - - const int uurows = (size + 44)/45; - char * uubuf = new char[uurows * 62+5]; - - const int uusz = uuencode_mem(uubuf, (char *)buffer, size); - delete[] buffer; - - m_output->println("GET CONFIG %d %d %d %d %d", - 0, version, node, size, uusz); - - m_output->println("begin 664 Ndb_cfg.bin"); - - /* XXX Need to write directly to the socket, because the uubuf is not - * NUL-terminated. This could/should probably be done in a nicer way. - */ - write_socket(m_socket, MAX_WRITE_TIMEOUT, uubuf, uusz); - delete[] uubuf; - - m_output->println("end"); - m_output->println(""); - return; - } - - if(compat){ - m_output->println("GET CONFIG %d %d %d %d %d",1, version, 0, 0, 0); - return; - } - if(node != 0){ bool compatible; switch (m_mgmsrv.getNodeType(node)) { diff --git a/ndb/src/mgmsrv/Services.hpp b/ndb/src/mgmsrv/Services.hpp index 4d904e8369e..48ba55a8b12 100644 --- a/ndb/src/mgmsrv/Services.hpp +++ b/ndb/src/mgmsrv/Services.hpp @@ -24,9 +24,6 @@ #include "MgmtSrvr.hpp" -/** Undefine this to remove backwards compatibility for "GET CONFIG". */ -#define MGM_GET_CONFIG_BACKWARDS_COMPAT - class MgmApiSession : public SocketServer::Session { static void stop_session_if_timed_out(SocketServer::Session *_s, void *data); @@ -42,9 +39,6 @@ private: char m_err_str[1024]; int m_stopSelf; // -1 is restart, 0 do nothing, 1 stop - void getConfig_common(Parser_t::Context &ctx, - const class Properties &args, - bool compat = false); const char *get_error_text(int err_no) { return m_mgmsrv.getErrorText(err_no, m_err_str, sizeof(m_err_str)); } @@ -55,9 +49,6 @@ public: void getStatPort(Parser_t::Context &ctx, const class Properties &args); void getConfig(Parser_t::Context &ctx, const class Properties &args); -#ifdef MGM_GET_CONFIG_BACKWARDS_COMPAT - void getConfig_old(Parser_t::Context &ctx); -#endif /* MGM_GET_CONFIG_BACKWARDS_COMPAT */ void get_nodeid(Parser_t::Context &ctx, const class Properties &args); void getVersion(Parser_t::Context &ctx, const class Properties &args); From e953dd8a35631fc3051d1b0f57fc3867b17bc851 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:47:34 +1100 Subject: [PATCH 07/20] BUG#26355 FIXME: use constant for max loglevel in ndb_mgmd ndb/include/mgmapi/mgmapi.h: use constant for max log level in ndb_mgmd. (more useful in 5.1 due to other defines and refinements of mgmapi) ndb/src/mgmsrv/Services.cpp: fix the XXX fixme of constant for max log level --- ndb/include/mgmapi/mgmapi.h | 2 ++ ndb/src/mgmsrv/Services.cpp | 8 +++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ndb/include/mgmapi/mgmapi.h b/ndb/include/mgmapi/mgmapi.h index 2423048f98f..e5889a1ee6d 100644 --- a/ndb/include/mgmapi/mgmapi.h +++ b/ndb/include/mgmapi/mgmapi.h @@ -16,6 +16,8 @@ #ifndef MGMAPI_H #define MGMAPI_H +#define NDB_MGM_MAX_LOGLEVEL 15 + /** * @mainpage MySQL Cluster Management API * diff --git a/ndb/src/mgmsrv/Services.cpp b/ndb/src/mgmsrv/Services.cpp index aa35c826535..01f71aa24f5 100644 --- a/ndb/src/mgmsrv/Services.cpp +++ b/ndb/src/mgmsrv/Services.cpp @@ -764,8 +764,7 @@ MgmApiSession::setClusterLogLevel(Parser::Context &, DBUG_PRINT("enter",("node=%d, category=%d, level=%d", node, cat, level)); - /* XXX should use constants for this value */ - if(level > 15) { + if(level > NDB_MGM_MAX_LOGLEVEL) { m_output->println(reply); m_output->println("result: Invalid loglevel %d", level); m_output->println(""); @@ -809,8 +808,7 @@ MgmApiSession::setLogLevel(Parser::Context &, args.get("category", &cat); args.get("level", &level); - /* XXX should use constants for this value */ - if(level > 15) { + if(level > NDB_MGM_MAX_LOGLEVEL) { m_output->println("set loglevel reply"); m_output->println("result: Invalid loglevel", errorString.c_str()); m_output->println(""); @@ -1510,7 +1508,7 @@ MgmApiSession::listen_event(Parser::Context & ctx, } int level = atoi(spec[1].c_str()); - if(level < 0 || level > 15){ + if(level < 0 || level > NDB_MGM_MAX_LOGLEVEL){ msg.appfmt("Invalid level: >%s<", spec[1].c_str()); result = -1; goto done; From cea0d57d7039cae92756c5b2305de1f0ee38f24d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:51:16 +1100 Subject: [PATCH 08/20] BUG#26356 uninitialised data sent from TAMPER_ORD to DIHNDBTAMPER Don't send uninit data in TAMPER_ORD to DIHNDBTAMPER Even though this data is unused from the CMVMI (mgmd) signal, we shouldn't be doing stuff with uninited data. ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: init the 3rd word of DIHNDBTAMPER before sending to DIH. --- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 5dd1e527dd2..00343172cb0 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -839,7 +839,7 @@ void Cmvmi::execTAMPER_ORD(Signal* signal) // to be able to indicate if we really introduced an error. #ifdef ERROR_INSERT TamperOrd* const tamperOrd = (TamperOrd*)&signal->theData[0]; - + signal->theData[2] = 0; signal->theData[1] = tamperOrd->errorNo; signal->theData[0] = 5; sendSignal(DBDIH_REF, GSN_DIHNDBTAMPER, signal, 3,JBB); From f8a679e9a674204e19458a3f468eb6c8f3f8b0f6 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:55:08 +1100 Subject: [PATCH 09/20] BUG#26357 remove unused GSN_STATISTICS_REQ and CONF remove GSN_STATISTICS_REQ and CONF These are unused and have been since BK import. not needed. ndb/include/kernel/GlobalSignalNumbers.h: remove STATISTICS_REQ and CONF ndb/src/common/debugger/signaldata/SignalNames.cpp: remove signal names for STATISTICS_REQ and CONF (unused) ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: remove unused STATISTICS signals ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp: remove unused STATISTICS signals --- ndb/include/kernel/GlobalSignalNumbers.h | 4 ++-- .../debugger/signaldata/SignalNames.cpp | 4 +--- ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 19 ------------------- ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp | 1 - 4 files changed, 3 insertions(+), 25 deletions(-) diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h index 08d35a0b0cb..78be268cbc7 100644 --- a/ndb/include/kernel/GlobalSignalNumbers.h +++ b/ndb/include/kernel/GlobalSignalNumbers.h @@ -540,13 +540,13 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; #define GSN_ABORT_ALL_REF 446 #define GSN_ABORT_ALL_CONF 447 -#define GSN_STATISTICS_REQ 448 +/* 448 unused - formerly GSN_STATISTICS_REQ */ #define GSN_STOP_ORD 449 #define GSN_TAMPER_ORD 450 #define GSN_SET_VAR_REQ 451 #define GSN_SET_VAR_CONF 452 #define GSN_SET_VAR_REF 453 -#define GSN_STATISTICS_CONF 454 +/* 454 unused - formerly GSN_STATISTICS_CONF */ #define GSN_START_ORD 455 /* 457 unused */ diff --git a/ndb/src/common/debugger/signaldata/SignalNames.cpp b/ndb/src/common/debugger/signaldata/SignalNames.cpp index 9839fd32cf2..36185638b57 100644 --- a/ndb/src/common/debugger/signaldata/SignalNames.cpp +++ b/ndb/src/common/debugger/signaldata/SignalNames.cpp @@ -380,15 +380,13 @@ const GsnName SignalNames [] = { ,{ GSN_TUP_WRITELOG_REQ, "TUP_WRITELOG_REQ" } ,{ GSN_LQH_WRITELOG_REQ, "LQH_WRITELOG_REQ" } - ,{ GSN_STATISTICS_REQ, "STATISTICS_REQ" } ,{ GSN_START_ORD, "START_ORD" } ,{ GSN_STOP_ORD, "STOP_ORD" } ,{ GSN_TAMPER_ORD, "TAMPER_ORD" } ,{ GSN_SET_VAR_REQ, "SET_VAR_REQ" } ,{ GSN_SET_VAR_CONF, "SET_VAR_CONF" } ,{ GSN_SET_VAR_REF, "SET_VAR_REF" } - ,{ GSN_STATISTICS_CONF, "STATISTICS_CONF" } - + ,{ GSN_EVENT_SUBSCRIBE_REQ, "EVENT_SUBSCRIBE_REQ" } ,{ GSN_EVENT_SUBSCRIBE_CONF, "EVENT_SUBSCRIBE_CONF" } ,{ GSN_EVENT_SUBSCRIBE_REF, "EVENT_SUBSCRIBE_REF" } diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 00343172cb0..9e8a1df0138 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -77,7 +77,6 @@ Cmvmi::Cmvmi(const Configuration & conf) : addRecSignal(GSN_OPEN_COMREQ, &Cmvmi::execOPEN_COMREQ); addRecSignal(GSN_TEST_ORD, &Cmvmi::execTEST_ORD); - addRecSignal(GSN_STATISTICS_REQ, &Cmvmi::execSTATISTICS_REQ); addRecSignal(GSN_TAMPER_ORD, &Cmvmi::execTAMPER_ORD); addRecSignal(GSN_SET_VAR_REQ, &Cmvmi::execSET_VAR_REQ); addRecSignal(GSN_SET_VAR_CONF, &Cmvmi::execSET_VAR_CONF); @@ -703,24 +702,6 @@ Cmvmi::execTEST_ORD(Signal * signal){ #endif } -void Cmvmi::execSTATISTICS_REQ(Signal* signal) -{ - // TODO Note ! This is only a test implementation... - - static int stat1 = 0; - jamEntry(); - - //ndbout << "data 1: " << signal->theData[1]; - - int x = signal->theData[0]; - stat1++; - signal->theData[0] = stat1; - sendSignal(x, GSN_STATISTICS_CONF, signal, 7, JBB); - -}//execSTATISTICS_REQ() - - - void Cmvmi::execSTOP_ORD(Signal* signal) { jamEntry(); diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp index e3a20795701..b4ed5e45490 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp @@ -55,7 +55,6 @@ private: void execSIZEALT_ACK(Signal* signal); void execTEST_ORD(Signal* signal); - void execSTATISTICS_REQ(Signal* signal); void execSTOP_ORD(Signal* signal); void execSTART_ORD(Signal* signal); void execTAMPER_ORD(Signal* signal); From 6f334b5558f48ed0b3fa4b9881d79a182f55348b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 16:03:25 +1100 Subject: [PATCH 10/20] BUG#26358 remove unused and non-working SET_VAR_REQ/CONF signals remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/include/kernel/GlobalSignalNumbers.h: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/common/debugger/signaldata/SignalNames.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbacc/Dbacc.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbacc/DbaccInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbacc/DbaccMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbdih/Dbdih.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dblqh/Dblqh.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dblqh/DblqhInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbtc/Dbtc.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbtc/DbtcInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbtup/Dbtup.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/dbtup/DbtupGen.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/qmgr/Qmgr.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/qmgr/QmgrInit.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/kernel/blocks/qmgr/QmgrMain.cpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) ndb/src/mgmsrv/MgmtSrvr.hpp: remove SET_VAR_REQ,REF,CONF - unused, #if 0 and confusing Remove the dead SET_VAR_REQ,REF,CONF signals. They: a) don't currently work b) will cause confusion with future mgmd updates for signal interface to configuration things (e.g. port numbers) --- ndb/include/kernel/GlobalSignalNumbers.h | 6 +- .../debugger/signaldata/SignalNames.cpp | 3 - ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp | 157 ------------------ ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp | 5 - ndb/src/kernel/blocks/dbacc/Dbacc.hpp | 1 - ndb/src/kernel/blocks/dbacc/DbaccInit.cpp | 1 - ndb/src/kernel/blocks/dbacc/DbaccMain.cpp | 27 --- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 - ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 1 - ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 24 --- ndb/src/kernel/blocks/dblqh/Dblqh.hpp | 1 - ndb/src/kernel/blocks/dblqh/DblqhInit.cpp | 1 - ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 24 --- ndb/src/kernel/blocks/dbtc/Dbtc.hpp | 1 - ndb/src/kernel/blocks/dbtc/DbtcInit.cpp | 1 - ndb/src/kernel/blocks/dbtc/DbtcMain.cpp | 30 ---- ndb/src/kernel/blocks/dbtup/Dbtup.hpp | 1 - ndb/src/kernel/blocks/dbtup/DbtupGen.cpp | 28 ---- ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp | 1 - ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp | 1 - ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 17 -- ndb/src/kernel/blocks/qmgr/Qmgr.hpp | 1 - ndb/src/kernel/blocks/qmgr/QmgrInit.cpp | 1 - ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 28 ---- ndb/src/mgmsrv/MgmtSrvr.hpp | 1 - 25 files changed, 3 insertions(+), 360 deletions(-) diff --git a/ndb/include/kernel/GlobalSignalNumbers.h b/ndb/include/kernel/GlobalSignalNumbers.h index 78be268cbc7..1ffc198de41 100644 --- a/ndb/include/kernel/GlobalSignalNumbers.h +++ b/ndb/include/kernel/GlobalSignalNumbers.h @@ -543,9 +543,9 @@ extern const GlobalSignalNumber NO_OF_SIGNAL_NAMES; /* 448 unused - formerly GSN_STATISTICS_REQ */ #define GSN_STOP_ORD 449 #define GSN_TAMPER_ORD 450 -#define GSN_SET_VAR_REQ 451 -#define GSN_SET_VAR_CONF 452 -#define GSN_SET_VAR_REF 453 +/* 451 unused - formerly GSN_SET_VAR_REQ */ +/* 452 unused - formerly GSN_SET_VAR_CONF */ +/* 453 unused - formerly GSN_SET_VAR_REF */ /* 454 unused - formerly GSN_STATISTICS_CONF */ #define GSN_START_ORD 455 diff --git a/ndb/src/common/debugger/signaldata/SignalNames.cpp b/ndb/src/common/debugger/signaldata/SignalNames.cpp index 36185638b57..66e7a10cdb7 100644 --- a/ndb/src/common/debugger/signaldata/SignalNames.cpp +++ b/ndb/src/common/debugger/signaldata/SignalNames.cpp @@ -383,9 +383,6 @@ const GsnName SignalNames [] = { ,{ GSN_START_ORD, "START_ORD" } ,{ GSN_STOP_ORD, "STOP_ORD" } ,{ GSN_TAMPER_ORD, "TAMPER_ORD" } - ,{ GSN_SET_VAR_REQ, "SET_VAR_REQ" } - ,{ GSN_SET_VAR_CONF, "SET_VAR_CONF" } - ,{ GSN_SET_VAR_REF, "SET_VAR_REF" } ,{ GSN_EVENT_SUBSCRIBE_REQ, "EVENT_SUBSCRIBE_REQ" } ,{ GSN_EVENT_SUBSCRIBE_CONF, "EVENT_SUBSCRIBE_CONF" } diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp index 9e8a1df0138..b8b539e22c9 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp @@ -78,9 +78,6 @@ Cmvmi::Cmvmi(const Configuration & conf) : addRecSignal(GSN_TEST_ORD, &Cmvmi::execTEST_ORD); addRecSignal(GSN_TAMPER_ORD, &Cmvmi::execTAMPER_ORD); - addRecSignal(GSN_SET_VAR_REQ, &Cmvmi::execSET_VAR_REQ); - addRecSignal(GSN_SET_VAR_CONF, &Cmvmi::execSET_VAR_CONF); - addRecSignal(GSN_SET_VAR_REF, &Cmvmi::execSET_VAR_REF); addRecSignal(GSN_STOP_ORD, &Cmvmi::execSTOP_ORD); addRecSignal(GSN_START_ORD, &Cmvmi::execSTART_ORD); addRecSignal(GSN_EVENT_SUBSCRIBE_REQ, @@ -828,160 +825,6 @@ void Cmvmi::execTAMPER_ORD(Signal* signal) }//execTAMPER_ORD() - - -void Cmvmi::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - jamEntry(); - switch (var) { - - // NDBCNTR_REF - - // DBTC - case TransactionDeadlockDetectionTimeout: - case TransactionInactiveTime: - case NoOfConcurrentProcessesHandleTakeover: - sendSignal(DBTC_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBDIH - case TimeBetweenLocalCheckpoints: - case TimeBetweenGlobalCheckpoints: - sendSignal(DBDIH_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBLQH - case NoOfConcurrentCheckpointsDuringRestart: - case NoOfConcurrentCheckpointsAfterRestart: - sendSignal(DBLQH_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBACC - case NoOfDiskPagesToDiskDuringRestartACC: - case NoOfDiskPagesToDiskAfterRestartACC: - sendSignal(DBACC_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBTUP - case NoOfDiskPagesToDiskDuringRestartTUP: - case NoOfDiskPagesToDiskAfterRestartTUP: - sendSignal(DBTUP_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // DBDICT - - // NDBCNTR - case TimeToWaitAlive: - - // QMGR - case HeartbeatIntervalDbDb: // TODO ev till Ndbcnt också - case HeartbeatIntervalDbApi: - case ArbitTimeout: - sendSignal(QMGR_REF, GSN_SET_VAR_REQ, signal, 3, JBB); - break; - - // NDBFS - - // CMVMI - case MaxNoOfSavedMessages: - case LockPagesInMainMemory: - case TimeBetweenWatchDogCheck: - case StopOnError: - handleSET_VAR_REQ(signal); - break; - - - // Not possible to update (this could of course be handled by each block - // instead but I havn't investigated where they belong) - case Id: - case ExecuteOnComputer: - case ShmKey: - case MaxNoOfConcurrentOperations: - case MaxNoOfConcurrentTransactions: - case MemorySpaceIndexes: - case MemorySpaceTuples: - case MemoryDiskPages: - case NoOfFreeDiskClusters: - case NoOfDiskClusters: - case NoOfFragmentLogFiles: - case NoOfDiskClustersPerDiskFile: - case NoOfDiskFiles: - case MaxNoOfSavedEvents: - default: - - int mgmtSrvr = setVarReq->mgmtSrvrBlockRef(); - sendSignal(mgmtSrvr, GSN_SET_VAR_REF, signal, 0, JBB); - } // switch - -#endif -}//execSET_VAR_REQ() - - -void Cmvmi::execSET_VAR_CONF(Signal* signal) -{ - int mgmtSrvr = signal->theData[0]; - sendSignal(mgmtSrvr, GSN_SET_VAR_CONF, signal, 0, JBB); - -}//execSET_VAR_CONF() - - -void Cmvmi::execSET_VAR_REF(Signal* signal) -{ - int mgmtSrvr = signal->theData[0]; - sendSignal(mgmtSrvr, GSN_SET_VAR_REF, signal, 0, JBB); - -}//execSET_VAR_REF() - - -void Cmvmi::handleSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - switch (var) { - case MaxNoOfSavedMessages: - theConfig.maxNoOfErrorLogs(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case LockPagesInMainMemory: - int result; - if (val == 0) { - result = NdbMem_MemUnlockAll(); - } - else { - result = NdbMem_MemLockAll(); - } - if (result == 0) { - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - } - else { - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } - break; - - case TimeBetweenWatchDogCheck: - theConfig.timeBetweenWatchDogCheck(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case StopOnError: - theConfig.stopOnError(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - return; - } // switch -#endif -} - #ifdef VM_TRACE class RefSignalTest { public: diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp index b4ed5e45490..712e70039c9 100644 --- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp +++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.hpp @@ -58,16 +58,11 @@ private: void execSTOP_ORD(Signal* signal); void execSTART_ORD(Signal* signal); void execTAMPER_ORD(Signal* signal); - void execSET_VAR_REQ(Signal* signal); - void execSET_VAR_CONF(Signal* signal); - void execSET_VAR_REF(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); void execEVENT_SUBSCRIBE_REQ(Signal *); void cancelSubscription(NodeId nodeId); - - void handleSET_VAR_REQ(Signal* signal); void execTESTSIG(Signal* signal); void execNODE_START_REP(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp index 43810a08ac7..02a7e69b684 100644 --- a/ndb/src/kernel/blocks/dbacc/Dbacc.hpp +++ b/ndb/src/kernel/blocks/dbacc/Dbacc.hpp @@ -911,7 +911,6 @@ private: void execDROP_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execDUMP_STATE_ORD(Signal* signal); // Statement blocks diff --git a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp index 024a32ca95c..80664e8911a 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp @@ -178,7 +178,6 @@ Dbacc::Dbacc(const class Configuration & conf): addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ); addRecSignal(GSN_FSREMOVECONF, &Dbacc::execFSREMOVECONF); addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbacc::execSET_VAR_REQ); initData(); diff --git a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp index 40af5a52c03..37f75d82710 100644 --- a/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp +++ b/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp @@ -11648,33 +11648,6 @@ Dbacc::execDUMP_STATE_ORD(Signal* signal) #endif }//Dbacc::execDUMP_STATE_ORD() -void Dbacc::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - - case NoOfDiskPagesToDiskAfterRestartACC: - clblPagesPerTick = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfDiskPagesToDiskDuringRestartACC: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif - -}//execSET_VAR_REQ() - void Dbacc::execREAD_PSUEDO_REQ(Signal* signal){ jamEntry(); diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index e8f24876979..ba2d8a6522a 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -693,7 +693,6 @@ private: void execFSREADREF(Signal *); void execFSWRITECONF(Signal *); void execFSWRITEREF(Signal *); - void execSET_VAR_REQ(Signal *); void execCHECKNODEGROUPSREQ(Signal *); void execSTART_INFOREQ(Signal*); void execSTART_INFOREF(Signal*); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index 360f320cb74..6e456c9c841 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -216,7 +216,6 @@ Dbdih::Dbdih(const class Configuration & config): addRecSignal(GSN_FSREADREF, &Dbdih::execFSREADREF, true); addRecSignal(GSN_FSWRITECONF, &Dbdih::execFSWRITECONF); addRecSignal(GSN_FSWRITEREF, &Dbdih::execFSWRITEREF, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbdih::execSET_VAR_REQ); addRecSignal(GSN_START_INFOREQ, &Dbdih::execSTART_INFOREQ); diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 5ee3ac8d67d..6839dca892f 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -14026,30 +14026,6 @@ Dbdih::execNDB_TAMPER(Signal* signal) return; }//Dbdih::execNDB_TAMPER() -void Dbdih::execSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - case TimeBetweenLocalCheckpoints: - c_lcpState.clcpDelay = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case TimeBetweenGlobalCheckpoints: - cgcpDelay = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -} - void Dbdih::execBLOCK_COMMIT_ORD(Signal* signal){ BlockCommitOrd* const block = (BlockCommitOrd *)&signal->theData[0]; diff --git a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp index 817832bdfcb..40eb6a9c668 100644 --- a/ndb/src/kernel/blocks/dblqh/Dblqh.hpp +++ b/ndb/src/kernel/blocks/dblqh/Dblqh.hpp @@ -2201,7 +2201,6 @@ private: void execFSREADCONF(Signal* signal); void execFSREADREF(Signal* signal); void execSCAN_HBREP(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execTIME_SIGNAL(Signal* signal); void execFSSYNCCONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp index 0b395e250c1..3452269be51 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp @@ -314,7 +314,6 @@ Dblqh::Dblqh(const class Configuration & conf): addRecSignal(GSN_FSREADCONF, &Dblqh::execFSREADCONF); addRecSignal(GSN_FSREADREF, &Dblqh::execFSREADREF, true); addRecSignal(GSN_ACC_ABORTCONF, &Dblqh::execACC_ABORTCONF); - addRecSignal(GSN_SET_VAR_REQ, &Dblqh::execSET_VAR_REQ); addRecSignal(GSN_TIME_SIGNAL, &Dblqh::execTIME_SIGNAL); addRecSignal(GSN_FSSYNCCONF, &Dblqh::execFSSYNCCONF); addRecSignal(GSN_REMOVE_MARKER_ORD, &Dblqh::execREMOVE_MARKER_ORD); diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 6a439b24c03..7e920b2e7e4 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -18902,30 +18902,6 @@ Dblqh::execDUMP_STATE_ORD(Signal* signal) }//Dblqh::execDUMP_STATE_ORD() -void Dblqh::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - - switch (var) { - - case NoOfConcurrentCheckpointsAfterRestart: - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfConcurrentCheckpointsDuringRestart: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -}//execSET_VAR_REQ() - - /* **************************************************************** */ /* ---------------------------------------------------------------- */ /* ---------------------- TRIGGER HANDLING ------------------------ */ diff --git a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp index d6c4529bb72..514cc2183aa 100644 --- a/ndb/src/kernel/blocks/dbtc/Dbtc.hpp +++ b/ndb/src/kernel/blocks/dbtc/Dbtc.hpp @@ -1323,7 +1323,6 @@ private: void execTIME_SIGNAL(Signal* signal); void execAPI_FAILREQ(Signal* signal); void execSCAN_HBREP(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execABORT_ALL_REQ(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp index 0b46f598a89..73149f0b6fd 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp @@ -256,7 +256,6 @@ Dbtc::Dbtc(const class Configuration & conf): addRecSignal(GSN_INCL_NODEREQ, &Dbtc::execINCL_NODEREQ); addRecSignal(GSN_TIME_SIGNAL, &Dbtc::execTIME_SIGNAL); addRecSignal(GSN_API_FAILREQ, &Dbtc::execAPI_FAILREQ); - addRecSignal(GSN_SET_VAR_REQ, &Dbtc::execSET_VAR_REQ); addRecSignal(GSN_TC_COMMIT_ACK, &Dbtc::execTC_COMMIT_ACK); addRecSignal(GSN_ABORT_ALL_REQ, &Dbtc::execABORT_ALL_REQ); diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp index 2b2e0e649a4..2afa077b672 100644 --- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp +++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp @@ -10999,36 +10999,6 @@ Dbtc::execDUMP_STATE_ORD(Signal* signal) } }//Dbtc::execDUMP_STATE_ORD() -void Dbtc::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - - switch (var) { - - case TransactionInactiveTime: - jam(); - set_appl_timeout_value(val); - break; - case TransactionDeadlockDetectionTimeout: - set_timeout_value(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfConcurrentProcessesHandleTakeover: - set_no_parallel_takeover(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif -} - void Dbtc::execABORT_ALL_REQ(Signal* signal) { jamEntry(); diff --git a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp index 3079a530807..c78e7d9bced 100644 --- a/ndb/src/kernel/blocks/dbtup/Dbtup.hpp +++ b/ndb/src/kernel/blocks/dbtup/Dbtup.hpp @@ -1116,7 +1116,6 @@ private: void execFSREADCONF(Signal* signal); void execNDB_STTOR(Signal* signal); void execREAD_CONFIG_REQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execDROP_TAB_REQ(Signal* signal); void execALTER_TAB_REQ(Signal* signal); void execFSREMOVECONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp index f21f2eba9fc..0f83c45077b 100644 --- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp +++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp @@ -103,7 +103,6 @@ Dbtup::Dbtup(const class Configuration & conf) addRecSignal(GSN_FSREADCONF, &Dbtup::execFSREADCONF); addRecSignal(GSN_NDB_STTOR, &Dbtup::execNDB_STTOR); addRecSignal(GSN_READ_CONFIG_REQ, &Dbtup::execREAD_CONFIG_REQ, true); - addRecSignal(GSN_SET_VAR_REQ, &Dbtup::execSET_VAR_REQ); // Trigger Signals addRecSignal(GSN_CREATE_TRIG_REQ, &Dbtup::execCREATE_TRIG_REQ); @@ -1315,32 +1314,5 @@ void Dbtup::seizePendingFileOpenInfoRecord(PendingFileOpenInfoPtr& pfoiPtr) pfoiPtr.p->pfoNextRec = RNIL; }//Dbtup::seizePendingFileOpenInfoRecord() -void Dbtup::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)signal->getDataPtrSend(); - ConfigParamId var = setVarReq->variable(); - int val = setVarReq->value(); - - switch (var) { - - case NoOfDiskPagesToDiskAfterRestartTUP: - clblPagesPerTick = val; - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case NoOfDiskPagesToDiskDuringRestartTUP: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - } // switch -#endif - -}//execSET_VAR_REQ() - - diff --git a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp index ec9d4a0dc60..80b0b29ea69 100644 --- a/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp +++ b/ndb/src/kernel/blocks/ndbcntr/Ndbcntr.hpp @@ -190,7 +190,6 @@ private: void execNDB_STARTCONF(Signal* signal); void execREAD_NODESREQ(Signal* signal); void execNDB_STARTREF(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execSTOP_PERM_REF(Signal* signal); void execSTOP_PERM_CONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp index 6df52b6fbe7..fdd6e7677d3 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrInit.cpp @@ -80,7 +80,6 @@ Ndbcntr::Ndbcntr(const class Configuration & conf): addRecSignal(GSN_NDB_STARTCONF, &Ndbcntr::execNDB_STARTCONF); addRecSignal(GSN_READ_NODESREQ, &Ndbcntr::execREAD_NODESREQ); addRecSignal(GSN_NDB_STARTREF, &Ndbcntr::execNDB_STARTREF); - addRecSignal(GSN_SET_VAR_REQ, &Ndbcntr::execSET_VAR_REQ); addRecSignal(GSN_STOP_PERM_REF, &Ndbcntr::execSTOP_PERM_REF); addRecSignal(GSN_STOP_PERM_CONF, &Ndbcntr::execSTOP_PERM_CONF); diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index 26e8f246293..87b71ba1c5f 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -2026,23 +2026,6 @@ Ndbcntr::execDUMP_STATE_ORD(Signal* signal) }//Ndbcntr::execDUMP_STATE_ORD() -void Ndbcntr::execSET_VAR_REQ(Signal* signal) { -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - - switch (var) { - case TimeToWaitAlive: - // Valid only during start so value not set. - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - }// switch -#endif -}//Ndbcntr::execSET_VAR_REQ() - void Ndbcntr::updateNodeState(Signal* signal, const NodeState& newState) const{ NodeStateRep * const stateRep = (NodeStateRep *)&signal->theData[0]; diff --git a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp index dcca240eeb6..9d2ac80d905 100644 --- a/ndb/src/kernel/blocks/qmgr/Qmgr.hpp +++ b/ndb/src/kernel/blocks/qmgr/Qmgr.hpp @@ -242,7 +242,6 @@ private: void execAPI_REGREQ(Signal* signal); void execAPI_FAILCONF(Signal* signal); void execREAD_NODESREQ(Signal* signal); - void execSET_VAR_REQ(Signal* signal); void execREAD_NODESREF(Signal* signal); void execREAD_NODESCONF(Signal* signal); diff --git a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index b8885569f0e..a087fe38c1c 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -82,7 +82,6 @@ Qmgr::Qmgr(const class Configuration & conf) addRecSignal(GSN_DISCONNECT_REP, &Qmgr::execDISCONNECT_REP); addRecSignal(GSN_API_FAILCONF, &Qmgr::execAPI_FAILCONF); addRecSignal(GSN_READ_NODESREQ, &Qmgr::execREAD_NODESREQ); - addRecSignal(GSN_SET_VAR_REQ, &Qmgr::execSET_VAR_REQ); addRecSignal(GSN_API_BROADCAST_REP, &Qmgr::execAPI_BROADCAST_REP); // Arbitration signals diff --git a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 0156f334051..c992ebe6cb9 100644 --- a/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -4774,34 +4774,6 @@ Qmgr::execDUMP_STATE_ORD(Signal* signal) #endif }//Qmgr::execDUMP_STATE_ORD() -void Qmgr::execSET_VAR_REQ(Signal* signal) -{ -#if 0 - SetVarReq* const setVarReq = (SetVarReq*)&signal->theData[0]; - ConfigParamId var = setVarReq->variable(); - UintR val = setVarReq->value(); - - switch (var) { - case HeartbeatIntervalDbDb: - setHbDelay(val/10); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case HeartbeatIntervalDbApi: - setHbApiDelay(val/10); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - case ArbitTimeout: - setArbitTimeout(val); - sendSignal(CMVMI_REF, GSN_SET_VAR_CONF, signal, 1, JBB); - break; - - default: - sendSignal(CMVMI_REF, GSN_SET_VAR_REF, signal, 1, JBB); - }// switch -#endif -}//execSET_VAR_REQ() void Qmgr::execAPI_BROADCAST_REP(Signal* signal) diff --git a/ndb/src/mgmsrv/MgmtSrvr.hpp b/ndb/src/mgmsrv/MgmtSrvr.hpp index 59f1487f7dc..62d2efd5b16 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.hpp +++ b/ndb/src/mgmsrv/MgmtSrvr.hpp @@ -597,7 +597,6 @@ private: */ enum WaitSignalType { NO_WAIT, // We don't expect to receive any signal - WAIT_SET_VAR, // Accept SET_VAR_CONF and SET_VAR_REF WAIT_SUBSCRIBE_CONF // Accept event subscription confirmation }; From 5a25c67a59b1e80fba4a0487508c899e6ae88d8f Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:16:26 +0700 Subject: [PATCH 11/20] Bug #21033 Error 0 in readAutoIncrementValue() - do not call function if table has no autoincrement --- sql/ha_ndbcluster.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index 30be53f1ddb..3d0d8a3f079 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -3245,7 +3245,7 @@ int ha_ndbcluster::info(uint flag) if (flag & HA_STATUS_AUTO) { DBUG_PRINT("info", ("HA_STATUS_AUTO")); - if (m_table) + if (m_table && table->found_next_number_field) { Ndb *ndb= get_ndb(); From ddc31bc9db705328ccad16d14cf4a90fc54fc098 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:26:06 +0700 Subject: [PATCH 12/20] backport some mysql-test ndbcluster things from 5.1 remove compiler warning EventLogger.cpp Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11 - partial fix - object map to handle failed realloc mysql-test/ndb/ndb_config_2_node.ini: backport some mysql-test ndbcluster things from 5.1 mysql-test/ndb/ndbcluster.sh: backport some mysql-test ndbcluster things from 5.1 ndb/src/common/debugger/EventLogger.cpp: remove compiler warning ndb/src/ndbapi/ObjectMap.hpp: Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11 - partial fix - object map to handle failed realloc --- mysql-test/ndb/ndb_config_2_node.ini | 10 +++ mysql-test/ndb/ndbcluster.sh | 97 +++++++++++++++++-------- ndb/src/common/debugger/EventLogger.cpp | 4 +- ndb/src/ndbapi/ObjectMap.hpp | 13 ++-- 4 files changed, 84 insertions(+), 40 deletions(-) diff --git a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini index a6a56376f33..aafed28dbc6 100644 --- a/mysql-test/ndb/ndb_config_2_node.ini +++ b/mysql-test/ndb/ndb_config_2_node.ini @@ -1,5 +1,6 @@ [ndbd default] NoOfReplicas= 2 +MaxNoOfConcurrentTransactions= 64 MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations DataMemory= CHOOSE_DataMemory IndexMemory= CHOOSE_IndexMemory @@ -7,6 +8,15 @@ Diskless= CHOOSE_Diskless TimeBetweenWatchDogCheck= 30000 DataDir= CHOOSE_FILESYSTEM MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes +MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes +TimeBetweenGlobalCheckpoints= 500 +NoOfFragmentLogFiles= 3 + +# +# Increase deadlock-timeout to cater for slow test-machines +# (possibly running several tests in parallell) +# +#TransactionDeadlockDetectionTimeout= 7500 [ndbd] HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress diff --git a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh index c53bf1306e6..be08781361e 100644 --- a/mysql-test/ndb/ndbcluster.sh +++ b/mysql-test/ndb/ndbcluster.sh @@ -63,12 +63,17 @@ stop_ndb= initial_ndb= status_ndb= ndb_diskless=0 +ndbd_nodes=2 +relative_config_data_dir= +opt_core= ndb_no_ord=512 +ndb_no_attr=2048 ndb_con_op=105000 ndb_dmem=80M ndb_imem=24M +VERBOSE=100 NDB_MGM_EXTRA_OPTS= NDB_MGMD_EXTRA_OPTS= NDBD_EXTRA_OPTS= @@ -89,6 +94,9 @@ while test $# -gt 0; do --debug*) flags_ndb="$flags_ndb $1" ;; + --ndbd-nodes=*) + ndbd_nodes=`echo "$1" | sed -e "s;--ndbd-nodes=;;"` + ;; --status) status_ndb=1 ;; @@ -104,6 +112,9 @@ while test $# -gt 0; do --data-dir=*) fsdir=`echo "$1" | sed -e "s;--data-dir=;;"` ;; + --relative-config-data-dir) + relative_config_data_dir=1 + ;; --port=*) port=`echo "$1" | sed -e "s;--port=;;"` ;; @@ -122,6 +133,12 @@ while test $# -gt 0; do --character-sets-dir=*) CHARSETSDIR=`echo "$1" | sed -e "s;--character-sets-dir=;;"` ;; + --core) + opt_core="--core" + ;; + --verbose=*) + VERBOSE=`echo "$1" | sed -e "s;--verbose=;;"` + ;; -- ) shift; break ;; --* ) $ECHO "Unrecognized option: $1"; exit 1 ;; * ) break ;; @@ -130,9 +147,10 @@ while test $# -gt 0; do done fs_ndb="$fsdir/ndbcluster-$port" +config_ini=ndb/ndb_config_${ndbd_nodes}_node.ini NDB_HOME= -if [ ! -x "$fsdir" ]; then +if [ ! -d "$fsdir" ]; then echo "$fsdir missing" exit 1 fi @@ -148,11 +166,15 @@ if [ ! -x "$exec_waiter" ]; then echo "$exec_waiter missing" exit 1 fi +if [ ! -f "$config_ini" ]; then + echo "$config_ini missing, unsupported number of nodes" + exit 1 +fi -exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS" -exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS" -exec_ndb="$exec_ndb --no-defaults $NDBD_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR" -exec_waiter="$exec_waiter --no-defaults" +exec_mgmtclient="$exec_mgmtclient --no-defaults $opt_core $NDB_MGM_EXTRA_OPTS" +exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $opt_core $NDB_MGMD_EXTRA_OPTS" +exec_ndb="$exec_ndb --no-defaults $opt_core $NDBD_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR" +exec_waiter="$exec_waiter --no-defaults $opt_core" ndb_host="localhost" ndb_mgmd_port=$port @@ -196,18 +218,24 @@ fi # Start management server as deamon # Edit file system path and ports in config file +if [ $relative_config_data_dir ] ; then + config_fs_ndb="." +else + config_fs_ndb=$fs_ndb +fi if [ $initial_ndb ] ; then - rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null + rm -rf $fs_ndb/ndb_* 2>&1 | cat > /dev/null sed \ + -e s,"CHOOSE_MaxNoOfAttributes","$ndb_no_attr",g \ -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \ -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \ -e s,"CHOOSE_DataMemory","$ndb_dmem",g \ -e s,"CHOOSE_IndexMemory","$ndb_imem",g \ -e s,"CHOOSE_Diskless","$ndb_diskless",g \ -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \ - -e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \ + -e s,"CHOOSE_FILESYSTEM","$config_fs_ndb",g \ -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \ - < ndb/ndb_config_2_node.ini \ + < "$config_ini" \ > "$fs_ndb/config.ini" fi @@ -218,7 +246,7 @@ if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else echo "Unable to start $exec_mgmtsrvr from `pwd`" exit 1 fi -if sleep_until_file_created $fs_ndb/ndb_3.pid 120 +if sleep_until_file_created $fs_ndb/ndb_`expr $ndbd_nodes + 1`.pid 120 then :; else exit 1 fi @@ -226,38 +254,43 @@ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" # Start database node -echo "Starting ndbd" -( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_1.pid 120 -then :; else - stop_default_ndbcluster - exit 1 -fi -cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" - -# Start database node - -echo "Starting ndbd" -( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) -if sleep_until_file_created $fs_ndb/ndb_2.pid 120 -then :; else - stop_default_ndbcluster - exit 1 -fi -cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" +id=1 +while [ $id -le $ndbd_nodes ] +do + if [ `expr $VERBOSE \> 1` = 1 ] ; then + echo "Starting ndbd $id($ndbd_nodes)" + fi + ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & ) + if sleep_until_file_created $fs_ndb/ndb_${id}.pid 120 + then :; else + stop_default_ndbcluster + exit 1 + fi + cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile" + id=`expr $id + 1` +done # test if Ndb Cluster starts properly -echo "Waiting for NDB data nodes to start..." -if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK" > /dev/null 2>&1; then :; else - echo "Ndbcluster startup failed" +if [ `expr $VERBOSE \> 1` = 1 ] ; then + echo "Waiting for NDB data nodes to start..." +fi +if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK" > /dev/null 2>&1 ; then :; else + if [ `expr $VERBOSE \> 0` = 1 ] ; then + echo "Ndbcluster startup failed" + fi stop_default_ndbcluster exit 1 fi +if [ `expr $VERBOSE \> 1` = 1 ] ; then + echo "Ok" +fi cat `find "$fs_ndb" -name 'ndb_*.pid'` > $fs_ndb/$pidfile -status_ndbcluster +if [ `expr $VERBOSE \> 2` = 1 ] ; then + status_ndbcluster +fi } status_ndbcluster() { diff --git a/ndb/src/common/debugger/EventLogger.cpp b/ndb/src/common/debugger/EventLogger.cpp index 39daa3effe8..535158fb7d1 100644 --- a/ndb/src/common/debugger/EventLogger.cpp +++ b/ndb/src/common/debugger/EventLogger.cpp @@ -530,8 +530,8 @@ void getTextUndoLogBlocked(QQQQ) { } void getTextTransporterError(QQQQ) { struct myTransporterError{ - int errorNum; - char errorString[256]; + Uint32 errorNum; + char errorString[256]; }; int i = 0; int lenth = 0; diff --git a/ndb/src/ndbapi/ObjectMap.hpp b/ndb/src/ndbapi/ObjectMap.hpp index 486ef08abb8..0e0c9668164 100644 --- a/ndb/src/ndbapi/ObjectMap.hpp +++ b/ndb/src/ndbapi/ObjectMap.hpp @@ -46,7 +46,7 @@ private: } * m_map; NdbMutex * m_mutex; - void expand(Uint32 newSize); + int expand(Uint32 newSize); }; inline @@ -73,9 +73,8 @@ NdbObjectIdMap::map(void * object){ // lock(); - if(m_firstFree == InvalidId){ - expand(m_expandSize); - } + if(m_firstFree == InvalidId && expand(m_expandSize)) + return InvalidId; Uint32 ff = m_firstFree; m_firstFree = m_map[ff].m_next; @@ -130,7 +129,7 @@ NdbObjectIdMap::getObject(Uint32 id){ return 0; } -inline void +inline int NdbObjectIdMap::expand(Uint32 incSize){ NdbMutex_Lock(m_mutex); Uint32 newSize = m_size + incSize; @@ -149,9 +148,11 @@ NdbObjectIdMap::expand(Uint32 incSize){ } else { - ndbout_c("NdbObjectIdMap::expand unable to expand!!"); + NdbMutex_Unlock(m_mutex); + return -1; } NdbMutex_Unlock(m_mutex); + return 0; } #endif From 69377dd20797fee8b2e4f5c5769d5e09319bd9c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Feb 2007 15:33:48 +0700 Subject: [PATCH 13/20] ndb_config_4_node.ini, ndb_config_1_node.ini: new file --- mysql-test/ndb/ndb_config_1_node.ini | 43 +++++++++++++++++++++++ mysql-test/ndb/ndb_config_4_node.ini | 52 ++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 mysql-test/ndb/ndb_config_1_node.ini create mode 100644 mysql-test/ndb/ndb_config_4_node.ini diff --git a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/ndb/ndb_config_1_node.ini new file mode 100644 index 00000000000..7b0d2829530 --- /dev/null +++ b/mysql-test/ndb/ndb_config_1_node.ini @@ -0,0 +1,43 @@ +[ndbd default] +NoOfReplicas= 1 +MaxNoOfConcurrentTransactions= 64 +MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations +DataMemory= CHOOSE_DataMemory +IndexMemory= CHOOSE_IndexMemory +Diskless= CHOOSE_Diskless +TimeBetweenWatchDogCheck= 30000 +DataDir= CHOOSE_FILESYSTEM +MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes +MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes +TimeBetweenGlobalCheckpoints= 500 +NoOfFragmentLogFiles= 3 + +# +# Increase deadlock-timeout to cater for slow test-machines +# (possibly running several tests in parallell) +# +#TransactionDeadlockDetectionTimeout= 7500 + +[ndbd] +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress + +[ndb_mgmd] +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress +DataDir= CHOOSE_FILESYSTEM # +PortNumber= CHOOSE_PORT_MGM + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] diff --git a/mysql-test/ndb/ndb_config_4_node.ini b/mysql-test/ndb/ndb_config_4_node.ini new file mode 100644 index 00000000000..2154475aa37 --- /dev/null +++ b/mysql-test/ndb/ndb_config_4_node.ini @@ -0,0 +1,52 @@ +[ndbd default] +NoOfReplicas= 2 +MaxNoOfConcurrentTransactions= 64 +MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations +DataMemory= CHOOSE_DataMemory +IndexMemory= CHOOSE_IndexMemory +Diskless= CHOOSE_Diskless +TimeBetweenWatchDogCheck= 30000 +DataDir= CHOOSE_FILESYSTEM +MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes +MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes +TimeBetweenGlobalCheckpoints= 500 +NoOfFragmentLogFiles= 3 + +# +# Increase deadlock-timeout to cater for slow test-machines +# (possibly running several tests in parallell) +# +#TransactionDeadlockDetectionTimeout= 7500 + +[ndbd] +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress + +[ndbd] +HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress + +[ndbd] +HostName= CHOOSE_HOSTNAME_3 # hostname is a valid network adress + +[ndbd] +HostName= CHOOSE_HOSTNAME_4 # hostname is a valid network adress + +[ndb_mgmd] +HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress +DataDir= CHOOSE_FILESYSTEM # +PortNumber= CHOOSE_PORT_MGM + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] + +[mysqld] From 2cd7831fb5d630da7451ba61f76b10c6a60c1500 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Feb 2007 18:10:27 +0100 Subject: [PATCH 14/20] ndb - bug#26454 make lockpages=1 run a bit earlier in startup ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp: change order --- ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp index fe6caf04d8c..a9039385805 100644 --- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp +++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp @@ -76,8 +76,8 @@ static BlockInfo ALL_BLOCKS[] = { { DBDICT_REF, 1 , 6000, 6003 }, { NDBFS_REF, 0 , 2000, 2999 }, { NDBCNTR_REF, 0 , 1000, 1999 }, + { CMVMI_REF, 1 , 9000, 9999 }, // before QMGR { QMGR_REF, 1 , 1, 999 }, - { CMVMI_REF, 1 , 9000, 9999 }, { TRIX_REF, 1 , 0, 0 }, { BACKUP_REF, 1 , 10000, 10999 }, { DBUTIL_REF, 1 , 11000, 11999 }, From 0e39133ad73e7ec7e821591d912509054174d697 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 16 Feb 2007 18:20:24 +0100 Subject: [PATCH 15/20] ndb - bug in my.cnf handling on resize of vector backport fix from 5.1 ndb/src/mgmsrv/InitConfigFileParser.cpp: backport fix from 5.1 --- ndb/src/mgmsrv/InitConfigFileParser.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ndb/src/mgmsrv/InitConfigFileParser.cpp b/ndb/src/mgmsrv/InitConfigFileParser.cpp index f937daf8620..264a998a67b 100644 --- a/ndb/src/mgmsrv/InitConfigFileParser.cpp +++ b/ndb/src/mgmsrv/InitConfigFileParser.cpp @@ -800,6 +800,7 @@ InitConfigFileParser::parse_mycnf() /** * Add ndbd, ndb_mgmd, api/mysqld */ + Uint32 idx = options.size(); { struct my_option opt; bzero(&opt, sizeof(opt)); @@ -809,7 +810,6 @@ InitConfigFileParser::parse_mycnf() opt.var_type = GET_STR; opt.arg_type = REQUIRED_ARG; options.push_back(opt); - ndbd = &options.back(); opt.name = "ndb_mgmd"; opt.id = 256; @@ -817,7 +817,6 @@ InitConfigFileParser::parse_mycnf() opt.var_type = GET_STR; opt.arg_type = REQUIRED_ARG; options.push_back(opt); - ndb_mgmd = &options.back(); opt.name = "mysqld"; opt.id = 256; @@ -825,20 +824,22 @@ InitConfigFileParser::parse_mycnf() opt.var_type = GET_STR; opt.arg_type = REQUIRED_ARG; options.push_back(opt); - mysqld = &options.back(); - opt.name = "api"; + opt.name = "ndbapi"; opt.id = 256; opt.value = (gptr*)malloc(sizeof(char*)); opt.var_type = GET_STR; opt.arg_type = REQUIRED_ARG; options.push_back(opt); - api = &options.back(); bzero(&opt, sizeof(opt)); options.push_back(opt); - } + ndbd = &options[idx]; + ndb_mgmd = &options[idx+1]; + mysqld = &options[idx+2]; + api = &options[idx+3]; + } Context ctx(m_info, m_errstream); const char *groups[]= { "cluster_config", 0 }; From 778b4aad59994e166f91c50b47d686a53a5e8b80 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 17 Feb 2007 23:52:17 +0100 Subject: [PATCH 16/20] ndb - bug#26457 master failure during master take over ndb/src/kernel/blocks/ERROR_codes.txt: new error code ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: Make sure to clear NF_XX_LCP if master fails during master take-over ndb/test/include/NdbRestarter.hpp: Add support for querying next master and node group (for multi node failure testing) ndb/test/ndbapi/testNodeRestart.cpp: testcase ndb/test/run-test/daily-basic-tests.txt: testcase ndb/test/src/NdbRestarter.cpp: Add support for querying next master and node group (for multi node failure testing) --- ndb/src/kernel/blocks/ERROR_codes.txt | 4 +- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 27 +++++++++- ndb/test/include/NdbRestarter.hpp | 2 + ndb/test/ndbapi/testNodeRestart.cpp | 42 +++++++++++++++ ndb/test/run-test/daily-basic-tests.txt | 4 ++ ndb/test/src/NdbRestarter.cpp | 62 +++++++++++++++++++++++ 6 files changed, 139 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt index 0bcc99a6334..f7cb49014cb 100644 --- a/ndb/src/kernel/blocks/ERROR_codes.txt +++ b/ndb/src/kernel/blocks/ERROR_codes.txt @@ -5,7 +5,7 @@ Next DBACC 3002 Next DBTUP 4014 Next DBLQH 5043 Next DBDICT 6007 -Next DBDIH 7178 +Next DBDIH 7181 Next DBTC 8039 Next CMVMI 9000 Next BACKUP 10022 @@ -71,6 +71,8 @@ Delay GCP_SAVEREQ by 10 secs 7177: Delay copying of sysfileData in execCOPY_GCIREQ +7180: Crash master during master-take-over in execMASTER_LCPCONF + ERROR CODES FOR TESTING NODE FAILURE, LOCAL CHECKPOINT HANDLING: ----------------------------------------------------------------- diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 5f573d40dfe..0e6fe4714b6 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4612,6 +4612,8 @@ void Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){ jam(); + Uint32 oldNode = c_lcpMasterTakeOverState.failedNodeId; + c_lcpMasterTakeOverState.minTableId = ~0; c_lcpMasterTakeOverState.minFragId = ~0; c_lcpMasterTakeOverState.failedNodeId = nodeId; @@ -4630,7 +4632,20 @@ Dbdih::startLcpMasterTakeOver(Signal* signal, Uint32 nodeId){ /** * Node failure during master take over... */ - ndbout_c("Nodefail during master take over"); + ndbout_c("Nodefail during master take over (old: %d)", oldNode); + } + + NodeRecordPtr nodePtr; + nodePtr.i = oldNode; + if (oldNode > 0 && oldNode < MAX_NDB_NODES) + { + jam(); + ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord); + if (nodePtr.p->m_nodefailSteps.get(NF_LCP_TAKE_OVER)) + { + jam(); + checkLocalNodefailComplete(signal, oldNode, NF_LCP_TAKE_OVER); + } } setLocalNodefailHandling(signal, nodeId, NF_LCP_TAKE_OVER); @@ -5646,6 +5661,14 @@ void Dbdih::execMASTER_LCPREQ(Signal* signal) jamEntry(); const BlockReference newMasterBlockref = req->masterRef; + if (newMasterBlockref != cmasterdihref) + { + jam(); + ndbout_c("resending GSN_MASTER_LCPREQ"); + sendSignalWithDelay(reference(), GSN_MASTER_LCPREQ, signal, + signal->getLength(), 50); + return; + } Uint32 failedNodeId = req->failedNodeId; /** @@ -5946,6 +5969,8 @@ void Dbdih::execMASTER_LCPCONF(Signal* signal) ptrCheckGuard(nodePtr, MAX_NDB_NODES, nodeRecord); nodePtr.p->lcpStateAtTakeOver = lcpState; + CRASH_INSERTION(7180); + #ifdef VM_TRACE ndbout_c("MASTER_LCPCONF"); printMASTER_LCP_CONF(stdout, &signal->theData[0], 0, 0); diff --git a/ndb/test/include/NdbRestarter.hpp b/ndb/test/include/NdbRestarter.hpp index 3ec92ae786e..a2e6a4b3248 100644 --- a/ndb/test/include/NdbRestarter.hpp +++ b/ndb/test/include/NdbRestarter.hpp @@ -62,6 +62,8 @@ public: int dumpStateAllNodes(int * _args, int _num_args); int getMasterNodeId(); + int getNextMasterNodeId(int nodeId); + int getNodeGroup(int nodeId); int getRandomNodeSameNodeGroup(int nodeId, int randomNumber); int getRandomNodeOtherNodeGroup(int nodeId, int randomNumber); int getRandomNotMasterNodeId(int randomNumber); diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index 43fb77342b5..e729e8179b5 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -1045,6 +1045,45 @@ int runBug25554(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_OK; } +int +runBug26457(NDBT_Context* ctx, NDBT_Step* step) +{ + NdbRestarter res; + if (res.getNumDbNodes() < 4) + return NDBT_OK; + + int loops = ctx->getNumLoops(); + while (loops --) + { +retry: + int master = res.getMasterNodeId(); + int next = res.getNextMasterNodeId(master); + + ndbout_c("master: %d next: %d", master, next); + + if (res.getNodeGroup(master) == res.getNodeGroup(next)) + { + res.restartOneDbNode(next, false, false, true); + if (res.waitClusterStarted()) + return NDBT_FAILED; + goto retry; + } + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 2 }; + + if (res.dumpStateOneNode(next, val2, 2)) + return NDBT_FAILED; + + if (res.insertErrorInNode(next, 7180)) + return NDBT_FAILED; + + res.restartOneDbNode(master, false, false, true); + if (res.waitClusterStarted()) + return NDBT_FAILED; + } + + return NDBT_OK; +} NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", @@ -1367,6 +1406,9 @@ TESTCASE("Bug25364", ""){ TESTCASE("Bug25554", ""){ INITIALIZER(runBug25554); } +TESTCASE("Bug26457", ""){ + INITIALIZER(runBug26457); +} NDBT_TESTSUITE_END(testNodeRestart); int main(int argc, const char** argv){ diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 00fa14eea2c..9074ff145d8 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -477,6 +477,10 @@ max-time: 1000 cmd: testNodeRestart args: -n Bug25554 T1 +max-time: 1000 +cmd: testNodeRestart +args: -n Bug26457 T1 + # OLD FLEX max-time: 500 cmd: flexBench diff --git a/ndb/test/src/NdbRestarter.cpp b/ndb/test/src/NdbRestarter.cpp index 2c16a05240d..4c7f52a8622 100644 --- a/ndb/test/src/NdbRestarter.cpp +++ b/ndb/test/src/NdbRestarter.cpp @@ -128,6 +128,68 @@ NdbRestarter::getMasterNodeId(){ return node; } +int +NdbRestarter::getNodeGroup(int nodeId){ + if (!isConnected()) + return -1; + + if (getStatus() != 0) + return -1; + + for(size_t i = 0; i < ndbNodes.size(); i++) + { + if(ndbNodes[i].node_id == nodeId) + { + return ndbNodes[i].node_group; + } + } + + return -1; +} + +int +NdbRestarter::getNextMasterNodeId(int nodeId){ + if (!isConnected()) + return -1; + + if (getStatus() != 0) + return -1; + + size_t i; + for(i = 0; i < ndbNodes.size(); i++) + { + if(ndbNodes[i].node_id == nodeId) + { + break; + } + } + assert(i < ndbNodes.size()); + if (i == ndbNodes.size()) + return -1; + + int dynid = ndbNodes[i].dynamic_id; + int minid = dynid; + for (i = 0; i minid) + minid = ndbNodes[i].dynamic_id; + + for (i = 0; i dynid && + ndbNodes[i].dynamic_id < minid) + { + minid = ndbNodes[i].dynamic_id; + } + + if (minid != ~0) + { + for (i = 0; i Date: Mon, 19 Feb 2007 20:13:08 +0100 Subject: [PATCH 17/20] ndb - bug#26481 fix for killed node during initial node restart ndb/src/kernel/blocks/dbdih/Dbdih.hpp: add flag for initial node restart, to keep track on when to concider it to be "done" ndb/src/kernel/blocks/dbdih/DbdihInit.cpp: add flag for initial node restart, to keep track on when to concider it to be "done" ndb/src/kernel/blocks/dbdih/DbdihMain.cpp: add flag for initial node restart, to keep track on when to concider it to be "done" ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Check cstartRecReq also when refusing GCP_SAVEREQ ndb/test/ndbapi/testNodeRestart.cpp: add testcase --- ndb/src/kernel/blocks/dbdih/Dbdih.hpp | 1 + ndb/src/kernel/blocks/dbdih/DbdihInit.cpp | 1 + ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 22 ++++++++++++ ndb/src/kernel/blocks/dblqh/DblqhMain.cpp | 3 +- ndb/test/ndbapi/testNodeRestart.cpp | 43 +++++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) diff --git a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp index f1b3897c76f..41240a2d620 100644 --- a/ndb/src/kernel/blocks/dbdih/Dbdih.hpp +++ b/ndb/src/kernel/blocks/dbdih/Dbdih.hpp @@ -1368,6 +1368,7 @@ private: Uint32 csystemnodes; Uint32 currentgcp; Uint32 c_newest_restorable_gci; + Uint32 c_set_initial_start_flag; enum GcpMasterTakeOverState { GMTOS_IDLE = 0, diff --git a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp index bb96c4b8831..4e71ecd5fe2 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp @@ -75,6 +75,7 @@ void Dbdih::initData() c_blockCommit = false; c_blockCommitNo = 1; cntrlblockref = RNIL; + c_set_initial_start_flag = FALSE; }//Dbdih::initData() void Dbdih::initRecords() diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index 0e6fe4714b6..bf71bc56723 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -667,6 +667,12 @@ done: { jam(); memcpy(sysfileData, cdata, sizeof(sysfileData)); + + if (c_set_initial_start_flag) + { + jam(); + Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits); + } } c_copyGCISlave.m_copyReason = reason; @@ -1260,6 +1266,11 @@ void Dbdih::execNDB_STTOR(Signal* signal) // The permission is given by the master node in the alive set. /*-----------------------------------------------------------------------*/ createMutexes(signal, 0); + if (cstarttype == NodeState::ST_INITIAL_NODE_RESTART) + { + jam(); + c_set_initial_start_flag = TRUE; // In sysfile... + } break; case ZNDB_SPH3: @@ -10277,6 +10288,17 @@ Dbdih::sendLCP_COMPLETE_REP(Signal* signal){ sendSignal(c_lcpState.m_masterLcpDihRef, GSN_LCP_COMPLETE_REP, signal, LcpCompleteRep::SignalLength, JBB); + + /** + * Say that an initial node restart does not need to be redone + * once node has been part of first LCP + */ + if (c_set_initial_start_flag && + c_lcpState.m_participatingLQH.get(getOwnNodeId())) + { + jam(); + c_set_initial_start_flag = FALSE; + } } /*-------------------------------------------------------------------------- */ diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp index 3d93ce3fc31..ab5deca27b5 100644 --- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp +++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp @@ -11673,7 +11673,8 @@ void Dblqh::execGCP_SAVEREQ(Signal* signal) return; } - if(getNodeState().getNodeRestartInProgress()){ + if(getNodeState().getNodeRestartInProgress() && cstartRecReq == ZFALSE) + { GCPSaveRef * const saveRef = (GCPSaveRef*)&signal->theData[0]; saveRef->dihPtr = dihPtr; saveRef->nodeId = getOwnNodeId(); diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index e729e8179b5..c8c8ddd88d6 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -1085,6 +1085,46 @@ retry: return NDBT_OK; } +int +runBug26481(NDBT_Context* ctx, NDBT_Step* step) +{ + + int result = NDBT_OK; + int loops = ctx->getNumLoops(); + int records = ctx->getNumRecords(); + NdbRestarter res; + + int node = res.getRandomNotMasterNodeId(rand()); + ndbout_c("node: %d", node); + if (res.restartOneDbNode(node, true, true, true)) + return NDBT_FAILED; + + if (res.waitNodesNoStart(&node, 1)) + return NDBT_FAILED; + + int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 }; + if (res.dumpStateOneNode(node, val2, 2)) + return NDBT_FAILED; + + if (res.insertErrorInNode(node, 7018)) + return NDBT_FAILED; + + if (res.startNodes(&node, 1)) + return NDBT_FAILED; + + res.waitNodesStartPhase(&node, 1, 3); + + if (res.waitNodesNoStart(&node, 1)) + return NDBT_FAILED; + + res.startNodes(&node, 1); + + if (res.waitClusterStarted()) + return NDBT_FAILED; + + return NDBT_OK; +} + NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ @@ -1409,6 +1449,9 @@ TESTCASE("Bug25554", ""){ TESTCASE("Bug26457", ""){ INITIALIZER(runBug26457); } +TESTCASE("Bug26481", ""){ + INITIALIZER(runBug26481); +} NDBT_TESTSUITE_END(testNodeRestart); int main(int argc, const char** argv){ From 2f58470f5d364643fb56abb7effacef8e32b3156 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Feb 2007 22:30:54 +0100 Subject: [PATCH 18/20] ndb - forgott to add testcase for bug#26481 ndb/test/run-test/daily-basic-tests.txt: forgott to add testcase for bug#26481 --- ndb/test/run-test/daily-basic-tests.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt index 9074ff145d8..baad45013dd 100644 --- a/ndb/test/run-test/daily-basic-tests.txt +++ b/ndb/test/run-test/daily-basic-tests.txt @@ -481,6 +481,10 @@ max-time: 1000 cmd: testNodeRestart args: -n Bug26457 T1 +max-time: 1000 +cmd: testNodeRestart +args: -n Bug26481 T1 + # OLD FLEX max-time: 500 cmd: flexBench From 2afacafb78861a6ba523a3d896d457e9c85aa93a Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 19 Feb 2007 22:51:04 +0100 Subject: [PATCH 19/20] ndb - fix correct argv/argc handling in testBitfield ndb/test/ndbapi/testBitfield.cpp: fix correct argv/argc handling in testBitfield --- ndb/test/ndbapi/testBitfield.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ndb/test/ndbapi/testBitfield.cpp b/ndb/test/ndbapi/testBitfield.cpp index e26f495f5a4..1d1e203d185 100644 --- a/ndb/test/ndbapi/testBitfield.cpp +++ b/ndb/test/ndbapi/testBitfield.cpp @@ -36,9 +36,10 @@ main(int argc, char** argv){ load_defaults("my",load_default_groups,&argc,&argv); int ho_error; - argc--; - argv++; - + if ((ho_error=handle_options(&argc, &argv, my_long_options, + ndb_std_get_one_option))) + return NDBT_ProgramExit(NDBT_WRONGARGS); + Ndb_cluster_connection con(opt_connect_str); if(con.connect(12, 5, 1)) { From 65e7108f695e58dc9316aaa5cbf2f14cfa0f31ba Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Feb 2007 00:55:33 +0100 Subject: [PATCH 20/20] fix compile error in testBitfield --- ndb/test/ndbapi/testBitfield.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ndb/test/ndbapi/testBitfield.cpp b/ndb/test/ndbapi/testBitfield.cpp index 1d1e203d185..8ba8f3d92ef 100644 --- a/ndb/test/ndbapi/testBitfield.cpp +++ b/ndb/test/ndbapi/testBitfield.cpp @@ -8,6 +8,15 @@ static const char* _dbname = "TEST_DB"; static int g_loops = 7; + +NDB_STD_OPTS_VARS; + +static struct my_option my_long_options[] = +{ + NDB_STD_OPTS("ndb_desc"), + { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0} +}; + static void usage() { ndb_std_print_version();