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
This commit is contained in:
tomas@whalegate.ndb.mysql.com 2007-05-09 15:03:01 +02:00
parent 9b1157537b
commit ef1fdd3017
3 changed files with 16 additions and 9 deletions

View File

@ -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;

View File

@ -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

View File

@ -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];