#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped
4073 Jonas Oreland 2010-12-21
ndb - this patch moves ClusterMgr storage of missed heartbeat count from trp_node to ClusterMgr::Node
modified:
storage/ndb/src/ndbapi/ClusterMgr.cpp
storage/ndb/src/ndbapi/ClusterMgr.hpp
=== modified file 'storage/ndb/src/ndbapi/ClusterMgr.cpp'
--- a/storage/ndb/src/ndbapi/ClusterMgr.cpp 2010-12-18 08:36:08 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp 2010-12-21 13:05:32 +0000
@@ -370,7 +370,7 @@ ClusterMgr::threadMain( ){
* It is now time to send a new Heartbeat
*/
if (theNode.hbCounter >= theNode.hbFrequency) {
- theNode.m_info.m_heartbeat_cnt++;
+ theNode.hbMissed++;
theNode.hbCounter = 0;
}
@@ -385,7 +385,7 @@ ClusterMgr::threadMain( ){
raw_sendSignal(&signal, nodeId);
}//if
- if (theNode.m_info.m_heartbeat_cnt == 4 && theNode.hbFrequency > 0){
+ if (theNode.hbMissed == 4 && theNode.hbFrequency > 0){
reportNodeFailed(i);
}//if
}
@@ -675,7 +675,7 @@ ClusterMgr::execAPI_REGCONF(const Uint32
} else {
set_node_alive(node, false);
}//if
- node.m_info.m_heartbeat_cnt = 0;
+ node.hbMissed = 0;
node.hbCounter = 0;
check_wait_for_hb(nodeId);
@@ -774,7 +774,7 @@ ClusterMgr::reportConnected(NodeId nodeI
Node & theNode = theNodes[nodeId];
theNode.set_connected(true);
- theNode.m_info.m_heartbeat_cnt = 0;
+ theNode.hbMissed = 0;
theNode.hbCounter = 0;
/**
=== modified file 'storage/ndb/src/ndbapi/ClusterMgr.hpp'
--- a/storage/ndb/src/ndbapi/ClusterMgr.hpp 2010-12-14 19:26:50 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.hpp 2010-12-21 13:05:32 +0000
@@ -79,6 +79,7 @@ public:
*/
Uint32 hbFrequency; // Heartbeat frequence
Uint32 hbCounter; // # milliseconds passed since last hb sent
+ Uint32 hbMissed; // # missed heartbeats
};
const trp_node & getNodeInfo(NodeId) const;
@@ -118,7 +119,7 @@ private:
void check_wait_for_hb(NodeId nodeId);
- inline void set_node_alive(Node& node, bool alive){
+ inline void set_node_alive(trp_node& node, bool alive){
// Only DB nodes can be "alive"
assert(!alive ||
@@ -167,7 +168,7 @@ void
ClusterMgr::hb_received(NodeId nodeId) {
// Check array bounds + don't allow node 0 to be touched
assert(nodeId > 0 && nodeId < MAX_NODES);
- theNodes[nodeId].m_info.m_heartbeat_cnt= 0;
+ theNodes[nodeId].hbMissed = 0;
}
/*****************************************************************************/
Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20101221130532-yiu7ou0c6wsqg0k1.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-telco-7.0 branch (jonas:4073) | Jonas Oreland | 21 Dec |