4075 Jonas Oreland 2010-12-21
ndb - fix indentation in ClusterMgr::forceHB
modified:
storage/ndb/src/ndbapi/ClusterMgr.cpp
4074 Jonas Oreland 2010-12-21
ndb - use different aliases for accessing trp_node vs 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-21 13:47:51 +0000
+++ b/storage/ndb/src/ndbapi/ClusterMgr.cpp 2010-12-21 14:13:47 +0000
@@ -217,75 +217,75 @@ ClusterMgr::doStop( ){
void
ClusterMgr::forceHB()
{
- theFacade.lock_mutex();
+ theFacade.lock_mutex();
- if(waitingForHB)
- {
- NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
- theFacade.unlock_mutex();
- return;
- }
+ if(waitingForHB)
+ {
+ NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
+ theFacade.unlock_mutex();
+ return;
+ }
- waitingForHB= true;
+ waitingForHB= true;
- NodeBitmask ndb_nodes;
- ndb_nodes.clear();
- waitForHBFromNodes.clear();
- for(Uint32 i = 1; i < MAX_NDB_NODES; i++)
+ NodeBitmask ndb_nodes;
+ ndb_nodes.clear();
+ waitForHBFromNodes.clear();
+ for(Uint32 i = 1; i < MAX_NDB_NODES; i++)
+ {
+ const trp_node &node= getNodeInfo(i);
+ if(!node.defined)
+ continue;
+ if(node.m_info.getType() == NodeInfo::DB)
{
- const trp_node &node= getNodeInfo(i);
- if(!node.defined)
- continue;
- if(node.m_info.getType() == NodeInfo::DB)
- {
- ndb_nodes.set(i);
- waitForHBFromNodes.bitOR(node.m_state.m_connected_nodes);
- }
+ ndb_nodes.set(i);
+ waitForHBFromNodes.bitOR(node.m_state.m_connected_nodes);
}
- waitForHBFromNodes.bitAND(ndb_nodes);
- theFacade.unlock_mutex();
+ }
+ waitForHBFromNodes.bitAND(ndb_nodes);
+ theFacade.unlock_mutex();
#ifdef DEBUG_REG
- char buf[128];
- ndbout << "Waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
+ char buf[128];
+ ndbout << "Waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
#endif
- NdbApiSignal signal(numberToRef(API_CLUSTERMGR, theFacade.ownId()));
+ NdbApiSignal signal(numberToRef(API_CLUSTERMGR, theFacade.ownId()));
- signal.theVerId_signalNumber = GSN_API_REGREQ;
- signal.theReceiversBlockNumber = QMGR;
- signal.theTrace = 0;
- signal.theLength = ApiRegReq::SignalLength;
-
- ApiRegReq * req = CAST_PTR(ApiRegReq, signal.getDataPtrSend());
- req->ref = numberToRef(API_CLUSTERMGR, theFacade.ownId());
- req->version = NDB_VERSION;
- req->mysql_version = NDB_MYSQL_VERSION_D;
+ signal.theVerId_signalNumber = GSN_API_REGREQ;
+ signal.theReceiversBlockNumber = QMGR;
+ signal.theTrace = 0;
+ signal.theLength = ApiRegReq::SignalLength;
+
+ ApiRegReq * req = CAST_PTR(ApiRegReq, signal.getDataPtrSend());
+ req->ref = numberToRef(API_CLUSTERMGR, theFacade.ownId());
+ req->version = NDB_VERSION;
+ req->mysql_version = NDB_MYSQL_VERSION_D;
+ {
+ Guard g(clusterMgrThreadMutex);
+ lock();
+ int nodeId= 0;
+ for(int i=0;
+ (int) NodeBitmask::NotFound != (nodeId= waitForHBFromNodes.find(i));
+ i= nodeId+1)
{
- Guard g(clusterMgrThreadMutex);
- lock();
- int nodeId= 0;
- for(int i=0;
- (int) NodeBitmask::NotFound != (nodeId= waitForHBFromNodes.find(i));
- i= nodeId+1)
- {
#ifdef DEBUG_REG
- ndbout << "FORCE HB to " << nodeId << endl;
+ ndbout << "FORCE HB to " << nodeId << endl;
#endif
- raw_sendSignal(&signal, nodeId);
- }
- unlock();
+ raw_sendSignal(&signal, nodeId);
}
- /* Wait for nodes to reply - if any heartbeats was sent */
- theFacade.lock_mutex();
- if (!waitForHBFromNodes.isclear())
- NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
+ unlock();
+ }
+ /* Wait for nodes to reply - if any heartbeats was sent */
+ theFacade.lock_mutex();
+ if (!waitForHBFromNodes.isclear())
+ NdbCondition_WaitTimeout(waitForHBCond, theFacade.theMutexPtr, 1000);
- waitingForHB= false;
+ waitingForHB= false;
#ifdef DEBUG_REG
- ndbout << "Still waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
+ ndbout << "Still waiting for HB from " << waitForHBFromNodes.getText(buf) << endl;
#endif
- theFacade.unlock_mutex();
+ theFacade.unlock_mutex();
}
void
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.1-telco-7.0 branch (jonas:4074 to 4075) | Jonas Oreland | 21 Dec |