diff options
author | unknown <tomas@whalegate.ndb.mysql.com> | 2007-05-09 15:03:01 +0200 |
---|---|---|
committer | unknown <tomas@whalegate.ndb.mysql.com> | 2007-05-09 15:03:01 +0200 |
commit | 198a7991c0738ea4ffbca828aa683020bb6243be (patch) | |
tree | fbd3253a43876608b91d30c18a2d1656ad9c1f41 /ndb | |
parent | 7ef22d8d22ee46ca69026563dbdc9bcccf5e7524 (diff) | |
download | mariadb-git-198a7991c0738ea4ffbca828aa683020bb6243be.tar.gz |
enable setting api reg req frequency to be higher than heartbeat setting to ensure we have reasonably up-to-date info from ndb nodes
+ do this for management server
Diffstat (limited to 'ndb')
-rw-r--r-- | ndb/src/mgmsrv/MgmtSrvr.cpp | 10 | ||||
-rw-r--r-- | ndb/src/ndbapi/ClusterMgr.cpp | 13 | ||||
-rw-r--r-- | ndb/src/ndbapi/ClusterMgr.hpp | 2 |
3 files changed, 16 insertions, 9 deletions
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 3d7eb5bd4f1..409694fead1 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -627,6 +627,16 @@ MgmtSrvr::start(BaseString &error_string) ndbout_c("This is probably a bug."); } + /* + set api reg req frequency quite high: + + 100 ms interval to make sure we have fairly up-to-date + info from the nodes. This to make sure that this info + is not dependent on heart beat settings in the + configuration + */ + theFacade->theClusterMgr->set_max_api_reg_req_interval(100); + TransporterRegistry *reg = theFacade->get_registry(); for(unsigned int i=0;i<reg->m_transporter_interface.size();i++) { BaseString msg; diff --git a/ndb/src/ndbapi/ClusterMgr.cpp b/ndb/src/ndbapi/ClusterMgr.cpp index 7ab3ee07197..d3946dddfb7 100644 --- a/ndb/src/ndbapi/ClusterMgr.cpp +++ b/ndb/src/ndbapi/ClusterMgr.cpp @@ -68,6 +68,7 @@ ClusterMgr::ClusterMgr(TransporterFacade & _facade): clusterMgrThreadMutex = NdbMutex_Create(); waitForHBCond= NdbCondition_Create(); waitingForHB= false; + m_max_api_reg_req_interval= 0xFFFFFFFF; // MAX_INT noOfAliveNodes= 0; noOfConnectedNodes= 0; theClusterMgrThread= 0; @@ -251,7 +252,7 @@ ClusterMgr::threadMain( ){ * Start of Secure area for use of Transporter */ theFacade.lock_mutex(); - for (int i = 1; i < MAX_NODES; i++){ + for (int i = 1; i < MAX_NDB_NODES; i++){ /** * Send register request (heartbeat) to all available nodes * at specified timing intervals @@ -272,7 +273,8 @@ ClusterMgr::threadMain( ){ } theNode.hbCounter += timeSlept; - if (theNode.hbCounter >= theNode.hbFrequency) { + if (theNode.hbCounter >= m_max_api_reg_req_interval || + theNode.hbCounter >= theNode.hbFrequency) { /** * It is now time to send a new Heartbeat */ @@ -281,13 +283,6 @@ ClusterMgr::threadMain( ){ theNode.hbCounter = 0; } - /** - * If the node is of type REP, - * then the receiver of the signal should be API_CLUSTERMGR - */ - if (theNode.m_info.m_type == NodeInfo::REP) { - signal.theReceiversBlockNumber = API_CLUSTERMGR; - } #ifdef DEBUG_REG ndbout_c("ClusterMgr: Sending API_REGREQ to node %d", (int)nodeId); #endif diff --git a/ndb/src/ndbapi/ClusterMgr.hpp b/ndb/src/ndbapi/ClusterMgr.hpp index f5d84fee01d..467b18f2330 100644 --- a/ndb/src/ndbapi/ClusterMgr.hpp +++ b/ndb/src/ndbapi/ClusterMgr.hpp @@ -50,6 +50,7 @@ public: void startThread(); void forceHB(); + void set_max_api_reg_req_interval(unsigned int millisec) { m_max_api_reg_req_interval = millisec; } private: void threadMain(); @@ -83,6 +84,7 @@ public: Uint32 m_connect_count; private: + Uint32 m_max_api_reg_req_interval; Uint32 noOfAliveNodes; Uint32 noOfConnectedNodes; Node theNodes[MAX_NODES]; |