Below is the list of changes that have just been committed into a local
5.0 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, 2006-10-26 10:45:46+02:00, jonas@stripped +10 -0
ndb -
Add some more version handling for easier/better online software upgrade handling
ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +1 -1
Add new signal
ndb/include/kernel/NodeInfo.hpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +10 -0
Add struct for min/max version of different types of nodes
ndb/include/kernel/signaldata/ApiRegSignalData.hpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +4 -1
Add more version info to ApiRegConf
(min/max of different types)
ndb/include/ndb_version.h.in@stripped, 2006-10-26 10:45:44+02:00, jonas@stripped
+3 -0
Add new signal
ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +1 -0
New signal
ndb/src/kernel/blocks/qmgr/Qmgr.hpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +5 -0
1) Add handling of min/max versions
2) Make sure newly started nodes gets info about version of each nodes real early
during startup...
ndb/src/kernel/blocks/qmgr/QmgrInit.cpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +8 -0
1) Add handling of min/max versions
2) Make sure newly started nodes gets info about version of each nodes real early
during startup...
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp@stripped, 2006-10-26 10:45:44+02:00,
jonas@stripped +133 -4
1) Add handling of min/max versions
2) Make sure newly started nodes gets info about version of each nodes real early
during startup...
ndb/src/kernel/vm/GlobalData.hpp@stripped, 2006-10-26 10:45:45+02:00,
jonas@stripped +1 -0
1) Add handling of min/max versions
2) Make sure newly started nodes gets info about version of each nodes real early
during startup...
ndb/src/kernel/vm/SimulatedBlock.hpp@stripped, 2006-10-26 10:45:45+02:00,
jonas@stripped +15 -0
1) Add handling of min/max versions
2) Make sure newly started nodes gets info about version of each nodes real early
during startup...
# 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/50-alcatel
--- 1.5/ndb/include/ndb_version.h.in 2006-10-26 10:45:50 +02:00
+++ 1.6/ndb/include/ndb_version.h.in 2006-10-26 10:45:50 +02:00
@@ -64,5 +64,8 @@
#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26)
#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12)
+
+#define NDBD_API_VERSION_REP MAKE_VERSION(5,1,3)
+
#endif
--- 1.17/ndb/include/kernel/GlobalSignalNumbers.h 2006-10-26 10:45:50 +02:00
+++ 1.18/ndb/include/kernel/GlobalSignalNumbers.h 2006-10-26 10:45:50 +02:00
@@ -179,7 +179,7 @@
#define GSN_CNTR_START_CONF 118
#define GSN_CNTR_START_REP 119
/* 120 unused */
-/* 121 unused */
+#define GSN_NODE_VERSION_REP 121 /* distr */
/* 122 unused */
/* 123 unused */
/* 124 unused */
--- 1.3/ndb/include/kernel/NodeInfo.hpp 2006-10-26 10:45:50 +02:00
+++ 1.4/ndb/include/kernel/NodeInfo.hpp 2006-10-26 10:45:50 +02:00
@@ -94,4 +94,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.3/ndb/include/kernel/signaldata/ApiRegSignalData.hpp 2006-10-26 10:45:50 +02:00
+++ 1.4/ndb/include/kernel/signaldata/ApiRegSignalData.hpp 2006-10-26 10:45:50 +02:00
@@ -80,13 +80,16 @@
friend class ClusterMgr;
public:
- STATIC_CONST( SignalLength = 3 + NodeState::DataLength );
+ STATIC_CONST( SignalLength = 3 +
+ NodeState::DataLength +
+ NodeVersionInfo::DataLength);
private:
Uint32 qmgrRef;
Uint32 version; // Version of NDB node
Uint32 apiHeartbeatFrequency;
NodeState nodeState;
+ NodeVersionInfo versionInfo;
};
#endif
--- 1.10/ndb/src/common/debugger/signaldata/SignalNames.cpp 2006-10-26 10:45:50 +02:00
+++ 1.11/ndb/src/common/debugger/signaldata/SignalNames.cpp 2006-10-26 10:45:50 +02:00
@@ -638,5 +638,6 @@
,{ GSN_DICT_UNLOCK_ORD, "DICT_UNLOCK_ORD" }
,{ GSN_UPDATE_FRAG_DIST_KEY_ORD, "UPDATE_FRAG_DIST_KEY_ORD" }
+ ,{ GSN_NODE_VERSION_REP, "NODE_VERSION_REP" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
--- 1.11/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2006-10-26 10:45:50 +02:00
+++ 1.12/ndb/src/kernel/blocks/qmgr/Qmgr.hpp 2006-10-26 10:45:50 +02:00
@@ -426,6 +426,11 @@
StopReq c_stopReq;
bool check_multi_node_shutdown(Signal* signal);
+
+ 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.8/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp 2006-10-26 10:45:50 +02:00
+++ 1.9/ndb/src/kernel/blocks/qmgr/QmgrInit.cpp 2006-10-26 10:45:50 +02: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()
@@ -101,6 +108,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.34/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2006-10-26 10:45:50 +02:00
+++ 1.35/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp 2006-10-26 10:45:50 +02:00
@@ -259,6 +259,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;
@@ -731,6 +734,7 @@
*/
UintR TdynId = ++c_maxDynamicId;
setNodeInfo(addNodePtr.i).m_version = startingVersion;
+ recompute_version_info(NodeInfo::DB, startingVersion);
addNodePtr.p->ndynamicId = TdynId;
/**
@@ -1356,6 +1360,7 @@
" starting: %s (missing fs for: %s)",
mask1, mask2);
progError(__LINE__, NDBD_EXIT_SR_RESTARTCONFLICT, buf);
+ return 0; // remove warning
}
void
@@ -1455,7 +1460,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;
@@ -1554,6 +1560,7 @@
}
sendCmAckAdd(signal, nodePtr.i, CmAdd::Prepare);
+ sendApiVersionRep(signal, nodePtr);
/* President have prepared us */
CmNodeInfoConf * conf = (CmNodeInfoConf*)signal->getDataPtrSend();
@@ -1566,6 +1573,29 @@
}
void
+Qmgr::sendApiVersionRep(Signal* signal, NodeRecPtr nodePtr)
+{
+ if (getNodeInfo(nodePtr.i).m_version >= NDBD_API_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();
@@ -2350,7 +2380,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();
@@ -2638,7 +2670,6 @@
}
setNodeInfo(apiNodePtr.i).m_version = version;
-
setNodeInfo(apiNodePtr.i).m_heartbeat_cnt= 0;
ApiRegConf * const apiRegConf = (ApiRegConf *)&signal->theData[0];
@@ -2659,8 +2690,9 @@
apiRegConf->nodeState.dynamicId = -dynamicId;
}
}
+ NodeVersionInfo info = getNodeVersionInfo();
apiRegConf->nodeState.m_connected_nodes.assign(c_connectedNodes);
-
+ apiRegConf->versionInfo = info;
sendSignal(ref, GSN_API_REGCONF, signal, ApiRegConf::SignalLength, JBB);
if ((getNodeState().startLevel == NodeState::SL_STARTED ||
@@ -2675,10 +2707,107 @@
apiNodePtr.p->blockRef = ref;
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_API_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_API_VERSION_REP)
+ {
+ jam();
+ sendSignal(calcQmgrBlockRef(i), GSN_NODE_VERSION_REP, signal, 2,JBB);
+ }
+ }
+ }
}
return;
}//Qmgr::execAPI_REGREQ()
+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;
+}
void
Qmgr::execAPI_VERSION_REQ(Signal * signal) {
--- 1.4/ndb/src/kernel/vm/GlobalData.hpp 2006-10-26 10:45:50 +02:00
+++ 1.5/ndb/src/kernel/vm/GlobalData.hpp 2006-10-26 10:45:50 +02:00
@@ -34,6 +34,7 @@
perform_stop};
struct GlobalData {
+ NodeVersionInfo m_versionInfo;
NodeInfo m_nodeInfo[MAX_NODES];
Signal VMSignals[1]; // Owned by FastScheduler::
--- 1.18/ndb/src/kernel/vm/SimulatedBlock.hpp 2006-10-26 10:45:50 +02:00
+++ 1.19/ndb/src/kernel/vm/SimulatedBlock.hpp 2006-10-26 10:45:50 +02:00
@@ -387,6 +387,9 @@
const NodeInfo & getNodeInfo(NodeId nodeId) const;
NodeInfo & setNodeInfo(NodeId);
+ const NodeVersionInfo& getNodeVersionInfo() const;
+ NodeVersionInfo& setNodeVersionInfo();
+
/**********************
* Xfrm stuff
*/
@@ -693,6 +696,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.0 tree (jonas:1.2262) | jonas | 26 Oct |