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-09-14 22:01:26+02:00, jonas@stripped +8 -0
ndb - bug#21535
send new fragdistkeys to all replicas during node recovery
to make sure that not 3rd or 4th replicas fragDistKey becomes out of sync
ndb/include/kernel/GlobalSignalNumbers.h@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +1 -0
new signal UpdateFragDistKeyOrd
ndb/include/kernel/signaldata/CopyFrag.hpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +13 -1
new signal UpdateFragDistKeyOrd
ndb/include/ndb_version.h.in@stripped, 2006-09-14 22:01:24+02:00, jonas@stripped
+2 -0
online software upgrade for new signal UpdateFragDistKeyOrd
ndb/src/common/debugger/signaldata/SignalNames.cpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +2 -1
new signal UpdateFragDistKeyOrd
ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +4 -1
Send noew list of all replicas in copyfragreq
ndb/src/kernel/blocks/dblqh/Dblqh.hpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +1 -0
new signal UpdateFragDistKeyOrd
ndb/src/kernel/blocks/dblqh/DblqhInit.cpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +3 -1
new signal UpdateFragDistKeyOrd
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2006-09-14 22:01:24+02:00,
jonas@stripped +65 -1
new signal UpdateFragDistKeyOrd
# 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-work
--- 1.4/ndb/include/ndb_version.h.in 2006-09-14 22:01:30 +02:00
+++ 1.5/ndb/include/ndb_version.h.in 2006-09-14 22:01:30 +02:00
@@ -62,5 +62,7 @@
#define NDBD_DICT_LOCK_VERSION_5 MAKE_VERSION(5,0,23)
+#define NDBD_UPDATE_FRAG_DIST_KEY_50 MAKE_VERSION(5,0,26)
+#define NDBD_UPDATE_FRAG_DIST_KEY_51 MAKE_VERSION(5,1,12)
#endif
--- 1.15/ndb/include/kernel/GlobalSignalNumbers.h 2006-09-14 22:01:30 +02:00
+++ 1.16/ndb/include/kernel/GlobalSignalNumbers.h 2006-09-14 22:01:30 +02:00
@@ -127,6 +127,7 @@
/* 68 unused */
/* 69 unused */
/* 70 unused */
+#define GSN_UPDATE_FRAG_DIST_KEY_ORD 70
#define GSN_ACC_ABORTREQ 71
#define GSN_ACC_CHECK_SCAN 72
#define GSN_ACC_COMMITCONF 73
--- 1.1/ndb/include/kernel/signaldata/CopyFrag.hpp 2006-09-14 22:01:30 +02:00
+++ 1.2/ndb/include/kernel/signaldata/CopyFrag.hpp 2006-09-14 22:01:30 +02:00
@@ -30,7 +30,8 @@
*/
friend class Dblqh;
public:
- STATIC_CONST( SignalLength = 7 );
+ STATIC_CONST( SignalLength = 8
+ );
private:
Uint32 userPtr;
@@ -40,6 +41,8 @@
Uint32 nodeId;
Uint32 schemaVersion;
Uint32 distributionKey;
+ Uint32 nodeCount;
+ Uint32 nodeList[1];
};
class CopyFragConf {
@@ -82,6 +85,15 @@
Uint32 tableId;
Uint32 fragId;
Uint32 errorCode;
+};
+
+struct UpdateFragDistKeyOrd
+{
+ Uint32 tableId;
+ Uint32 fragId;
+ Uint32 fragDistributionKey;
+
+ STATIC_CONST( SignalLength = 3 );
};
#endif
--- 1.9/ndb/src/common/debugger/signaldata/SignalNames.cpp 2006-09-14 22:01:30 +02:00
+++ 1.10/ndb/src/common/debugger/signaldata/SignalNames.cpp 2006-09-14 22:01:30 +02:00
@@ -636,6 +636,7 @@
,{ GSN_DICT_LOCK_CONF, "DICT_LOCK_CONF" }
,{ GSN_DICT_LOCK_REF, "DICT_LOCK_REF" }
,{ GSN_DICT_UNLOCK_ORD, "DICT_UNLOCK_ORD" }
-
+
+ ,{ GSN_UPDATE_FRAG_DIST_KEY_ORD, "UPDATE_FRAG_DIST_KEY_ORD" }
};
const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);
--- 1.58/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2006-09-14 22:01:30 +02:00
+++ 1.59/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2006-09-14 22:01:30 +02:00
@@ -3078,7 +3078,10 @@
copyFragReq->nodeId = takeOverPtr.p->toStartingNode;
copyFragReq->schemaVersion = tabPtr.p->schemaVersion;
copyFragReq->distributionKey = fragPtr.p->distributionKey;
- sendSignal(ref, GSN_COPY_FRAGREQ, signal, CopyFragReq::SignalLength, JBB);
+ copyFragReq->nodeCount = extractNodeInfo(fragPtr.p,
+ copyFragReq->nodeList);
+ sendSignal(ref, GSN_COPY_FRAGREQ, signal,
+ CopyFragReq::SignalLength + copyFragReq->nodeCount, JBB);
} else {
ndbrequire(takeOverPtr.p->toMasterStatus == TakeOverRecord::COMMIT_CREATE);
jam();
--- 1.39/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2006-09-14 22:01:30 +02:00
+++ 1.40/ndb/src/kernel/blocks/dblqh/Dblqh.hpp 2006-09-14 22:01:30 +02:00
@@ -2161,6 +2161,7 @@
void execSTORED_PROCCONF(Signal* signal);
void execSTORED_PROCREF(Signal* signal);
void execCOPY_FRAGREQ(Signal* signal);
+ void execUPDATE_FRAG_DIST_KEY_ORD(Signal*);
void execCOPY_ACTIVEREQ(Signal* signal);
void execCOPY_STATEREQ(Signal* signal);
void execLQH_TRANSREQ(Signal* signal);
--- 1.15/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2006-09-14 22:01:30 +02:00
+++ 1.16/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp 2006-09-14 22:01:30 +02:00
@@ -335,7 +335,9 @@
addRecSignal(GSN_TUX_ADD_ATTRREF, &Dblqh::execTUX_ADD_ATTRREF);
addRecSignal(GSN_READ_PSUEDO_REQ, &Dblqh::execREAD_PSUEDO_REQ);
-
+ addRecSignal(GSN_UPDATE_FRAG_DIST_KEY_ORD,
+ &Dblqh::execUPDATE_FRAG_DIST_KEY_ORD);
+
initData();
#ifdef VM_TRACE
--- 1.93/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2006-09-14 22:01:30 +02:00
+++ 1.94/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2006-09-14 22:01:30 +02:00
@@ -9109,7 +9109,12 @@
ndbrequire(cfirstfreeTcConrec != RNIL);
ndbrequire(fragptr.p->m_scanNumberMask.get(NR_ScanNo));
- fragptr.p->fragDistributionKey = copyFragReq->distributionKey;
+ Uint32 key = fragptr.p->fragDistributionKey = copyFragReq->distributionKey;
+
+ Uint32 nodeCount = copyFragReq->nodeCount;
+ Uint32 nodeList[MAX_REPLICAS];
+ ndbrequire(nodeCount <= MAX_REPLICAS);
+ memcpy(nodeList, copyFragReq->nodeList, 4*nodeCount);
if (DictTabInfo::isOrderedIndex(tabptr.p->tableType)) {
jam();
@@ -9184,9 +9189,56 @@
req->savePointId = tcConnectptr.p->savePointId;
sendSignal(tcConnectptr.p->tcAccBlockref, GSN_ACC_SCANREQ, signal,
AccScanReq::SignalLength, JBB);
+
+ Uint32 i;
+ NdbNodeBitmask mask;
+ for (i = 0; i<nodeCount; i++)
+ {
+ ndbout_c("nodeList: %d", nodeList[i]);
+ mask.set(nodeList[i]);
+ }
+ ndbrequire(mask.get(getOwnNodeId()));
+ ndbrequire(mask.get(nodeId)); // cpy dest
+ if (!mask.isclear())
+ {
+ UpdateFragDistKeyOrd* ord =(UpdateFragDistKeyOrd*)signal->getDataPtrSend();
+ ord->tableId = tabptr.i;
+ ord->fragId = fragId;
+ ord->fragDistributionKey = key;
+ i = 0;
+ while ((i = mask.find(i+1)) != NdbNodeBitmask::NotFound)
+ {
+#ifdef NDB_VERSION >= MAKE_VERSION(5,1,0)
+ Uint32 checkversion = NDBD_UPDATE_FRAG_DIST_KEY_51;
+#elif NDB_VERSION >= MAKE_VERSION(5,0,0)
+ Uint32 checkversion = NDBD_UPDATE_FRAG_DIST_KEY_50;
+#endif
+ checkversion = NDB_VERSION;
+ if (getNodeInfo(i).m_version >= checkversion)
+ sendSignal(calcLqhBlockRef(i), GSN_UPDATE_FRAG_DIST_KEY_ORD,
+ signal, UpdateFragDistKeyOrd::SignalLength, JBB);
+ }
+ }
return;
}//Dblqh::execCOPY_FRAGREQ()
+void
+Dblqh::execUPDATE_FRAG_DIST_KEY_ORD(Signal * signal)
+{
+ jamEntry();
+ UpdateFragDistKeyOrd* ord =(UpdateFragDistKeyOrd*)signal->getDataPtr();
+
+ tabptr.i = ord->tableId;
+ ptrCheckGuard(tabptr, ctabrecFileSize, tablerec);
+ ndbrequire(getFragmentrec(signal, ord->fragId));
+ fragptr.p->fragDistributionKey = ord->fragDistributionKey;
+
+ ndbout_c("UpdateFragDistKeyOrd tab: %d frag: %d key: %d",
+ tabptr.i,
+ ord->fragId,
+ ord->fragDistributionKey);
+}
+
void Dblqh::accScanConfCopyLab(Signal* signal)
{
AccScanConf * const accScanConf = (AccScanConf *)&signal->theData[0];
@@ -18437,6 +18489,18 @@
if(tabPtr.p->tableStatus != Tablerec::NOT_DEFINED){
infoEvent("Table %d Status: %d Usage: %d",
i, tabPtr.p->tableStatus, tabPtr.p->usageCount);
+
+ for (Uint32 j = 0; j<MAX_FRAG_PER_NODE; j++)
+ {
+ FragrecordPtr fragPtr;
+ if ((fragPtr.i = tabPtr.p->fragrec[j]) != RNIL)
+ {
+ ptrCheckGuard(fragPtr, cfragrecFileSize, fragrecord);
+ infoEvent(" frag: %d distKey: %u",
+ tabPtr.p->fragid[j],
+ fragPtr.p->fragDistributionKey);
+ }
+ }
}
}
return;
| Thread |
|---|
| • bk commit into 5.0 tree (jonas:1.2247) BUG#21535 | jonas | 14 Sep |