Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-01-04 10:59:12+01:00, jonas@stripped +10 -0
ndb - recommit extra version info to real-51
storage/ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +1 -1
add extra version info to main clone
storage/ndb/include/kernel/NodeInfo.hpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +10 -0
add extra version info to main clone
storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +2 -1
add extra version info to main clone
storage/ndb/include/ndb_version.h.in@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +2 -0
add extra version info to main clone
storage/ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +1 -0
add extra version info to main clone
storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +5 -0
add extra version info to main clone
storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +8 -0
add extra version info to main clone
storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +132 -4
add extra version info to main clone
storage/ndb/src/kernel/vm/GlobalData.hpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +1 -0
add extra version info to main clone
storage/ndb/src/kernel/vm/SimulatedBlock.hpp@stripped, 2007-01-04 10:59:10+01:00, jonas@stripped +15 -0
add extra version info to main clone
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/51-work
--- 1.12/storage/ndb/include/ndb_version.h.in 2007-01-04 10:59:18 +01:00
+++ 1.13/storage/ndb/include/ndb_version.h.in 2007-01-04 10:59:18 +01:00
@@ -72,5 +72,7 @@
#define NDBD_QMGR_SINGLEUSER_VERSION_5 MAKE_VERSION(5,0,25)
+#define NDBD_NODE_VERSION_REP MAKE_VERSION(6,1,1)
+
#endif
--- 1.30/storage/ndb/include/kernel/GlobalSignalNumbers.h 2007-01-04 10:59:18 +01:00
+++ 1.31/storage/ndb/include/kernel/GlobalSignalNumbers.h 2007-01-04 10:59:18 +01:00
@@ -183,7 +183,7 @@
#define GSN_CNTR_START_REP 119
/* 120 not unused */
#define GSN_ROUTE_ORD 121
-/* 122 unused */
+#define GSN_NODE_VERSION_REP 122
/* 123 unused */
/* 124 unused */
#define GSN_CHECK_LCP_STOP 125
--- 1.5/storage/ndb/include/kernel/NodeInfo.hpp 2007-01-04 10:59:18 +01:00
+++ 1.6/storage/ndb/include/kernel/NodeInfo.hpp 2007-01-04 10:59:18 +01:00
@@ -90,4 +90,14 @@
return ndbout;
}
+struct NodeVersionInfo
+{
+ STATIC_CONST( DataLength = 6 );
+ struct
+ {
+ Uint32 m_min_version;
+ Uint32 m_max_version;
+ } m_type [3]; // Indexed as NodeInfo::Type
+};
+
#endif
--- 1.4/storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp 2007-01-04 10:59:18 +01:00
+++ 1.5/storage/ndb/include/kernel/signaldata/ApiRegSignalData.hpp 2007-01-04 10:59:18 +01:00
@@ -80,12 +80,13 @@
friend class ClusterMgr;
public:
- STATIC_CONST( SignalLength = 3 + NodeState::DataLength );
+ STATIC_CONST( SignalLength = 4 + NodeState::DataLength );
private:
Uint32 qmgrRef;
Uint32 version; // Version of NDB node
Uint32 apiHeartbeatFrequency;
+ Uint32 minDbVersion;
NodeState nodeState;
};
--- 1.15/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2007-01-04 10:59:18 +01:00
+++ 1.16/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp 2007-01-04 10:59:18 +01:00
@@ -637,5 +637,6 @@
,{ GSN_DICT_COMMIT_REQ, "DICT_COMMIT_REQ"}
,{ GSN_ROUTE_ORD, "ROUTE_ORD" }
+ ,{ GSN_NODE_VERSION_REP, "NODE_VERSION_REP" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
--- 1.15/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2007-01-04 10:59:18 +01:00
+++ 1.16/storage/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2007-01-04 10:59:18 +01:00
@@ -450,6 +450,11 @@
#ifdef ERROR_INSERT
Uint32 c_error_insert_extra;
#endif
+
+ void recompute_version_info(Uint32 type);
+ void recompute_version_info(Uint32 type, Uint32 version);
+ void execNODE_VERSION_REP(Signal* signal);
+ void sendApiVersionRep(Signal* signal, NodeRecPtr nodePtr);
};
#endif
--- 1.11/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp 2007-01-04 10:59:18 +01:00
+++ 1.12/storage/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp 2007-01-04 10:59:18 +01:00
@@ -37,6 +37,13 @@
setHbApiDelay(hbDBAPI);
c_connectedNodes.set(getOwnNodeId());
c_stopReq.senderRef = 0;
+
+ /**
+ * Check sanity for NodeVersion
+ */
+ ndbrequire((Uint32)NodeInfo::DB == 0);
+ ndbrequire((Uint32)NodeInfo::API == 1);
+ ndbrequire((Uint32)NodeInfo::MGM == 2);
}//Qmgr::initData()
void Qmgr::initRecords()
@@ -107,6 +114,7 @@
addRecSignal(GSN_DIH_RESTARTREF, &Qmgr::execDIH_RESTARTREF);
addRecSignal(GSN_DIH_RESTARTCONF, &Qmgr::execDIH_RESTARTCONF);
+ addRecSignal(GSN_NODE_VERSION_REP, &Qmgr::execNODE_VERSION_REP);
initData();
}//Qmgr::Qmgr()
--- 1.43/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2007-01-04 10:59:18 +01:00
+++ 1.44/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2007-01-04 10:59:18 +01:00
@@ -260,6 +260,9 @@
case 1:
initData(signal);
startphase1(signal);
+ recompute_version_info(NodeInfo::DB);
+ recompute_version_info(NodeInfo::API);
+ recompute_version_info(NodeInfo::MGM);
return;
case 7:
cactivateApiCheck = 1;
@@ -765,6 +768,7 @@
*/
UintR TdynId = ++c_maxDynamicId;
setNodeInfo(addNodePtr.i).m_version = startingVersion;
+ recompute_version_info(NodeInfo::DB, startingVersion);
addNodePtr.p->ndynamicId = TdynId;
/**
@@ -1503,7 +1507,8 @@
replyNodePtr.p->ndynamicId = dynamicId;
replyNodePtr.p->blockRef = signal->getSendersBlockRef();
setNodeInfo(replyNodePtr.i).m_version = version;
-
+ recompute_version_info(NodeInfo::DB, version);
+
if(!c_start.m_nodes.done()){
jam();
return;
@@ -1602,6 +1607,7 @@
}
sendCmAckAdd(signal, nodePtr.i, CmAdd::Prepare);
+ sendApiVersionRep(signal, nodePtr);
/* President have prepared us */
CmNodeInfoConf * conf = (CmNodeInfoConf*)signal->getDataPtrSend();
@@ -1614,6 +1620,29 @@
}
void
+Qmgr::sendApiVersionRep(Signal* signal, NodeRecPtr nodePtr)
+{
+ if (getNodeInfo(nodePtr.i).m_version >= NDBD_NODE_VERSION_REP)
+ {
+ jam();
+ Uint32 ref = calcQmgrBlockRef(nodePtr.i);
+ for(Uint32 i = 1; i<MAX_NODES; i++)
+ {
+ jam();
+ Uint32 version = getNodeInfo(i).m_version;
+ Uint32 type = getNodeInfo(i).m_type;
+ if (type != NodeInfo::DB && version)
+ {
+ jam();
+ signal->theData[0] = i;
+ signal->theData[1] = version;
+ sendSignal(ref, GSN_NODE_VERSION_REP, signal, 2, JBB);
+ }
+ }
+ }
+}
+
+void
Qmgr::sendCmAckAdd(Signal * signal, Uint32 nodeId, CmAdd::RequestType type){
CmAckAdd * cmAckAdd = (CmAckAdd*)signal->getDataPtrSend();
@@ -2401,7 +2430,9 @@
* SECONDS.
*-------------------------------------------------------------------------*/
setNodeInfo(failedNodePtr.i).m_heartbeat_cnt= 0;
-
+ setNodeInfo(failedNodePtr.i).m_version = 0;
+ recompute_version_info(getNodeInfo(failedNodePtr.i).m_type);
+
CloseComReqConf * const closeCom = (CloseComReqConf *)&signal->theData[0];
closeCom->xxxBlockRef = reference();
@@ -2707,7 +2738,6 @@
}
setNodeInfo(apiNodePtr.i).m_version = version;
-
setNodeInfo(apiNodePtr.i).m_heartbeat_cnt= 0;
ApiRegConf * const apiRegConf = (ApiRegConf *)&signal->theData[0];
@@ -2728,8 +2758,9 @@
apiRegConf->nodeState.dynamicId = -dynamicId;
}
}
+ NodeVersionInfo info = getNodeVersionInfo();
+ apiRegConf->minDbVersion = info.m_type[NodeInfo::DB].m_min_version;
apiRegConf->nodeState.m_connected_nodes.assign(c_connectedNodes);
-
sendSignal(ref, GSN_API_REGCONF, signal, ApiRegConf::SignalLength, JBB);
if (apiNodePtr.p->phase == ZAPI_INACTIVE &&
@@ -2748,6 +2779,33 @@
signal->theData[0] = apiNodePtr.i;
sendSignal(CMVMI_REF, GSN_ENABLE_COMORD, signal, 1, JBA);
+ recompute_version_info(type, version);
+
+ if (info.m_type[NodeInfo::DB].m_min_version >= NDBD_NODE_VERSION_REP)
+ {
+ jam();
+ NodeReceiverGroup rg(QMGR, c_clusterNodes);
+ rg.m_nodes.clear(getOwnNodeId());
+ signal->theData[0] = apiNodePtr.i;
+ signal->theData[1] = version;
+ sendSignal(rg, GSN_NODE_VERSION_REP, signal, 2, JBB);
+ }
+ else
+ {
+ Uint32 i = 0;
+ while((i = c_clusterNodes.find(i + 1)) != NdbNodeBitmask::NotFound)
+ {
+ jam();
+ if (i == getOwnNodeId())
+ continue;
+ if (getNodeInfo(i).m_version >= NDBD_NODE_VERSION_REP)
+ {
+ jam();
+ sendSignal(calcQmgrBlockRef(i), GSN_NODE_VERSION_REP, signal, 2,JBB);
+ }
+ }
+ }
+
signal->theData[0] = apiNodePtr.i;
EXECUTE_DIRECT(NDBCNTR, GSN_API_START_REP, signal, 1);
}
@@ -2783,6 +2841,76 @@
ApiVersionConf::SignalLength, JBB);
}
+void
+Qmgr::execNODE_VERSION_REP(Signal* signal)
+{
+ jamEntry();
+ Uint32 nodeId = signal->theData[0];
+ Uint32 version = signal->theData[1];
+
+ if (nodeId < MAX_NODES)
+ {
+ jam();
+ Uint32 type = getNodeInfo(nodeId).m_type;
+ setNodeInfo(nodeId).m_version = version;
+ recompute_version_info(type, version);
+ }
+}
+
+void
+Qmgr::recompute_version_info(Uint32 type, Uint32 version)
+{
+ NodeVersionInfo& info = setNodeVersionInfo();
+ switch(type){
+ case NodeInfo::DB:
+ case NodeInfo::API:
+ case NodeInfo::MGM:
+ break;
+ default:
+ return;
+ }
+
+ if (info.m_type[type].m_min_version == 0 ||
+ version < info.m_type[type].m_min_version)
+ info.m_type[type].m_min_version = version;
+ if (version > info.m_type[type].m_max_version)
+ info.m_type[type].m_max_version = version;
+}
+
+void
+Qmgr::recompute_version_info(Uint32 type)
+{
+ switch(type){
+ case NodeInfo::DB:
+ case NodeInfo::API:
+ case NodeInfo::MGM:
+ break;
+ default:
+ return;
+ }
+
+ Uint32 min = ~0, max = 0;
+ Uint32 cnt = type == NodeInfo::DB ? MAX_NDB_NODES : MAX_NODES;
+ for (Uint32 i = 1; i<cnt; i++)
+ {
+ if (getNodeInfo(i).m_type == type)
+ {
+ Uint32 version = getNodeInfo(i).m_version;
+
+ if (version)
+ {
+ if (version < min)
+ min = version;
+ if (version > max)
+ max = version;
+ }
+ }
+ }
+
+ NodeVersionInfo& info = setNodeVersionInfo();
+ info.m_type[type].m_min_version = min == ~(Uint32)0 ? 0 : min;
+ info.m_type[type].m_max_version = max;
+}
#if 0
bool
--- 1.7/storage/ndb/src/kernel/vm/GlobalData.hpp 2007-01-04 10:59:18 +01:00
+++ 1.8/storage/ndb/src/kernel/vm/GlobalData.hpp 2007-01-04 10:59:18 +01:00
@@ -36,6 +36,7 @@
struct GlobalData {
Uint32 m_restart_seq; //
+ NodeVersionInfo m_versionInfo;
NodeInfo m_nodeInfo[MAX_NODES];
Signal VMSignals[1]; // Owned by FastScheduler::
--- 1.27/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2007-01-04 10:59:18 +01:00
+++ 1.28/storage/ndb/src/kernel/vm/SimulatedBlock.hpp 2007-01-04 10:59:18 +01:00
@@ -403,6 +403,9 @@
const NodeInfo & getNodeInfo(NodeId nodeId) const;
NodeInfo & setNodeInfo(NodeId);
+ const NodeVersionInfo& getNodeVersionInfo() const;
+ NodeVersionInfo& setNodeVersionInfo();
+
/**********************
* Xfrm stuff
*/
@@ -707,6 +710,18 @@
SimulatedBlock::getNodeInfo(NodeId nodeId) const {
ndbrequire(nodeId > 0 && nodeId < MAX_NODES);
return globalData.m_nodeInfo[nodeId];
+}
+
+inline
+const NodeVersionInfo &
+SimulatedBlock::getNodeVersionInfo() const {
+ return globalData.m_versionInfo;
+}
+
+inline
+NodeVersionInfo &
+SimulatedBlock::setNodeVersionInfo() {
+ return globalData.m_versionInfo;
}
inline
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2360) | jonas | 4 Jan |