From d951bc61ffdfd070bcbcd871b81c414c886c6d8a Mon Sep 17 00:00:00 2001 From: "mskold@mysql.com" <> Date: Wed, 5 Jul 2006 15:04:47 +0200 Subject: [PATCH] Bug #19645 Data Node hangs in phase 100: distribute API_FAIL_REQ so all nodes have the same view of what API's are connected --- storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp | 1 + .../ndb/src/kernel/blocks/qmgr/QmgrInit.cpp | 1 + .../ndb/src/kernel/blocks/qmgr/QmgrMain.cpp | 25 +++++++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp b/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp index 70c0fdfc988..de080237668 100644 --- a/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp +++ b/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp @@ -248,6 +248,7 @@ private: void execAPI_FAILCONF(Signal* signal); void execREAD_NODESREQ(Signal* signal); void execSET_VAR_REQ(Signal* signal); + void execAPI_FAILREQ(Signal* signal); void execREAD_NODESREF(Signal* signal); void execREAD_NODESCONF(Signal* signal); diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp index 6ee24561b0a..8ec5e681045 100644 --- a/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp +++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp @@ -81,6 +81,7 @@ Qmgr::Qmgr(Block_context& ctx) addRecSignal(GSN_API_REGREQ, &Qmgr::execAPI_REGREQ); addRecSignal(GSN_API_VERSION_REQ, &Qmgr::execAPI_VERSION_REQ); addRecSignal(GSN_DISCONNECT_REP, &Qmgr::execDISCONNECT_REP); + addRecSignal(GSN_API_FAILREQ, &Qmgr::execAPI_FAILREQ); addRecSignal(GSN_API_FAILCONF, &Qmgr::execAPI_FAILCONF); addRecSignal(GSN_READ_NODESREQ, &Qmgr::execREAD_NODESREQ); addRecSignal(GSN_SET_VAR_REQ, &Qmgr::execSET_VAR_REQ); diff --git a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp index 1eac369ec65..e3cb45bb1e7 100644 --- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp +++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp @@ -2338,6 +2338,8 @@ void Qmgr::sendApiFailReq(Signal* signal, Uint16 failedNodeNo) ndbrequire(failedNodePtr.p->failState == NORMAL); failedNodePtr.p->failState = WAITING_FOR_FAILCONF1; + NodeReceiverGroup rg(QMGR, c_clusterNodes); + sendSignal(rg, GSN_API_FAILREQ, signal, 2, JBA); sendSignal(DBTC_REF, GSN_API_FAILREQ, signal, 2, JBA); sendSignal(DBDICT_REF, GSN_API_FAILREQ, signal, 2, JBA); sendSignal(SUMA_REF, GSN_API_FAILREQ, signal, 2, JBA); @@ -2361,6 +2363,29 @@ void Qmgr::sendApiFailReq(Signal* signal, Uint16 failedNodeNo) CloseComReqConf::SignalLength, JBA); }//Qmgr::sendApiFailReq() +void Qmgr::execAPI_FAILREQ(Signal* signal) +{ + jamEntry(); + NodeRecPtr failedNodePtr; + failedNodePtr.i = signal->theData[0]; + // signal->theData[1] == QMGR_REF + ptrCheckGuard(failedNodePtr, MAX_NODES, nodeRec); + + ndbout_c("Qmgr::execAPI_FAILREQ node %d", failedNodePtr.i); + + ndbrequire(getNodeInfo(failedNodePtr.i).getType() != NodeInfo::DB); + + // ignore if api not active + if (failedNodePtr.p->phase != ZAPI_ACTIVE) + return; + + signal->theData[0] = NDB_LE_Disconnected; + signal->theData[1] = failedNodePtr.i; + sendSignal(CMVMI_REF, GSN_EVENT_REP, signal, 2, JBB); + + node_failed(signal, failedNodePtr.i); +} + void Qmgr::execAPI_FAILCONF(Signal* signal) { NodeRecPtr failedNodePtr;