Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas 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-03-22 13:20:42+01:00, tomas@stripped +7 -0
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-new-ndb
MERGE: 1.1810.2374.88
sql/ha_ndbcluster.cc@stripped, 2007-03-22 13:20:36+01:00, tomas@stripped +0
-0
Auto merged
MERGE: 1.175.1.127
sql/ha_ndbcluster.h@stripped, 2007-03-22 13:20:36+01:00, tomas@stripped +0
-0
Auto merged
MERGE: 1.82.4.12
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp@stripped, 2007-03-22 13:20:36+01:00,
tomas@stripped +0 -0
Auto merged
MERGE: 1.8.19.2
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp@stripped, 2007-03-22 13:20:35+01:00,
tomas@stripped +0 -0
Merge rename: ndb/src/kernel/blocks/dbdih/Dbdih.hpp ->
storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-03-22 13:20:36+01:00,
tomas@stripped +0 -0
Auto merged
MERGE: 1.24.77.2
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp@stripped, 2007-03-22 13:20:35+01:00,
tomas@stripped +0 -0
Merge rename: ndb/src/kernel/blocks/dbdih/DbdihMain.cpp ->
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-03-22 13:20:36+01:00,
tomas@stripped +0 -0
Auto merged
MERGE: 1.26.20.2
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp@stripped, 2007-03-22 13:20:35+01:00,
tomas@stripped +0 -0
Merge rename: ndb/src/kernel/blocks/dbtc/Dbtc.hpp ->
storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-03-22 13:20:36+01:00,
tomas@stripped +0 -0
Auto merged
MERGE: 1.73.40.2
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2007-03-22 13:20:35+01:00,
tomas@stripped +0 -0
Merge rename: ndb/src/kernel/blocks/dbtc/DbtcMain.cpp ->
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-03-22 13:20:36+01:00,
tomas@stripped +0 -0
Auto merged
MERGE: 1.13.25.2
storage/ndb/test/ndbapi/testNodeRestart.cpp@stripped, 2007-03-22 13:20:35+01:00,
tomas@stripped +0 -0
Merge rename: ndb/test/ndbapi/testNodeRestart.cpp ->
storage/ndb/test/ndbapi/testNodeRestart.cpp
# 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: tomas
# Host: whalegate.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-new-ndb/RESYNC
--- 1.8.19.1/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2007-03-21 15:42:10 +01:00
+++ 1.34/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp 2007-03-22 13:20:36 +01:00
@@ -20,7 +20,6 @@
#include <pc.hpp>
#include <SimulatedBlock.hpp>
#include "Sysfile.hpp"
-#include <ArrayList.hpp>
#include <SignalCounter.hpp>
#include <signaldata/MasterLCP.hpp>
@@ -60,17 +59,12 @@
// ------------------------------------------
// Error Codes for Transactions (None sofar)
// ------------------------------------------
+#define ZUNDEFINED_FRAGMENT_ERROR 311
// --------------------------------------
// Error Codes for Add Table
// --------------------------------------
#define ZREPLERROR1 306
-#define ZNOTIMPLEMENTED 307
-#define ZTABLEINSTALLED 310
-// --------------------------------------
-// Error Codes for Scan Table
-// --------------------------------------
-#define ZERRONOUSSTATE 308
// --------------------------------------
// Crash Codes
@@ -235,6 +229,8 @@
Uint32 storedReplicas; /* "ALIVE" STORED REPLICAS */
Uint32 nextFragmentChunk;
+ Uint32 m_log_part_id;
+
Uint8 distributionKey;
Uint8 fragReplicas;
Uint8 noOldStoredReplicas; /* NUMBER OF "DEAD" STORED REPLICAS */
@@ -467,14 +463,22 @@
TS_DROPPING = 3
};
enum Method {
- HASH = 0,
- NOTDEFINED = 1
+ LINEAR_HASH = 0,
+ NOTDEFINED = 1,
+ NORMAL_HASH = 2,
+ USER_DEFINED = 3
+ };
+ enum Storage {
+ ST_NOLOGGING = 0, // Table is not logged, but survives SR
+ ST_NORMAL = 1, // Normal table, logged and durable
+ ST_TEMPORARY = 2 // Table is lost after SR, not logged
};
CopyStatus tabCopyStatus;
UpdateState tabUpdateState;
TabLcpStatus tabLcpStatus;
TabStatus tabStatus;
Method method;
+ Storage tabStorage;
Uint32 pageRef[8];
//-----------------------------------------------------------------------------
@@ -507,7 +511,6 @@
Uint8 kvalue;
Uint8 noOfBackups;
Uint8 noPages;
- Uint8 storedTable; /* 0 IF THE TABLE IS A TEMPORARY TABLE */
Uint16 tableType;
Uint16 primaryTableId;
};
@@ -540,7 +543,9 @@
TO_END_COPY = 19,
TO_END_COPY_ONGOING = 20,
TO_WAIT_ENDING = 21,
- ENDING = 22
+ ENDING = 22,
+
+ STARTING_LOCAL_FRAGMENTS = 24
};
enum ToSlaveStatus {
TO_SLAVE_IDLE = 0,
@@ -567,7 +572,7 @@
typedef Ptr<TakeOverRecord> TakeOverRecordPtr;
public:
- Dbdih(const class Configuration &);
+ Dbdih(Block_context& ctx);
virtual ~Dbdih();
struct RWFragment {
@@ -631,6 +636,7 @@
void execTCGETOPSIZECONF(Signal *);
void execTC_CLOPSIZECONF(Signal *);
+ int handle_invalid_lcp_no(const class LcpFragRep*, ReplicaRecordPtr);
void execLCP_FRAG_REP(Signal *);
void execLCP_COMPLETE_REP(Signal *);
void execSTART_LCP_REQ(Signal *);
@@ -682,6 +688,7 @@
void execGETGCIREQ(Signal *);
void execDIH_RESTARTREQ(Signal *);
void execSTART_RECCONF(Signal *);
+ void execSTART_FRAGREF(Signal *);
void execSTART_FRAGCONF(Signal *);
void execADD_FRAGCONF(Signal *);
void execADD_FRAGREF(Signal *);
@@ -972,7 +979,9 @@
void initialiseRecordsLab(Signal *, Uint32 stepNo, Uint32, Uint32);
void findReplica(ReplicaRecordPtr& regReplicaPtr,
- Fragmentstore* fragPtrP, Uint32 nodeId);
+ Fragmentstore* fragPtrP,
+ Uint32 nodeId,
+ bool oldStoredReplicas = false);
//------------------------------------
// Node failure handling methods
//------------------------------------
@@ -1133,6 +1142,10 @@
void setNodeCopyCompleted(Uint32 nodeId, bool newState);
bool checkNodeAlive(Uint32 nodeId);
+ void nr_start_fragments(Signal*, TakeOverRecordPtr);
+ void nr_start_fragment(Signal*, TakeOverRecordPtr, ReplicaRecordPtr);
+ void nr_run_redo(Signal*, TakeOverRecordPtr);
+
// Initialisation
void initData();
void initRecords();
@@ -1159,7 +1172,8 @@
Uint32 c_nextNodeGroup;
NodeGroupRecord *nodeGroupRecord;
-
+ Uint32 c_nextLogPart;
+
NodeRecord *nodeRecord;
PageRecord *pageRecord;
@@ -1554,13 +1568,13 @@
* Pool/list of WaitGCPProxyRecord record
*/
ArrayPool<WaitGCPProxyRecord> waitGCPProxyPool;
- ArrayList<WaitGCPProxyRecord> c_waitGCPProxyList;
+ DLList<WaitGCPProxyRecord> c_waitGCPProxyList;
/**
* Pool/list of WaitGCPMasterRecord record
*/
ArrayPool<WaitGCPMasterRecord> waitGCPMasterPool;
- ArrayList<WaitGCPMasterRecord> c_waitGCPMasterList;
+ DLList<WaitGCPMasterRecord> c_waitGCPMasterList;
void checkWaitGCPProxy(Signal*, NodeId failedNodeId);
void checkWaitGCPMaster(Signal*, NodeId failedNodeId);
@@ -1602,6 +1616,8 @@
* Reply from nodeId
*/
void startInfoReply(Signal *, Uint32 nodeId);
+
+ void dump_replica_info();
// DIH specifics for execNODE_START_REP (sendDictUnlockOrd)
void execNODE_START_REP(Signal* signal);
--- 1.24.77.1/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-03-21 15:42:10 +01:00
+++ 1.116/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp 2007-03-22 13:20:36 +01:00
@@ -66,6 +66,7 @@
#include <signaldata/CreateFragmentation.hpp>
#include <signaldata/LqhFrag.hpp>
#include <signaldata/FsOpenReq.hpp>
+#include <signaldata/DihFragCount.hpp>
#include <signaldata/DictLock.hpp>
#include <DebuggerNames.hpp>
@@ -609,6 +610,14 @@
checkWaitDropTabFailedLqh(signal, nodeId, tableId);
return;
}
+ case DihContinueB::ZTO_START_FRAGMENTS:
+ {
+ TakeOverRecordPtr takeOverPtr;
+ takeOverPtr.i = signal->theData[1];
+ ptrCheckGuard(takeOverPtr, MAX_NDB_NODES, takeOverRecord);
+ nr_start_fragments(signal, takeOverPtr);
+ return;
+ }
}//switch
ndbrequire(false);
@@ -665,7 +674,9 @@
if (cmasterdihref != reference())
{
jam();
+ Uint32 tmp= SYSFILE->m_restart_seq;
memcpy(sysfileData, cdata, sizeof(sysfileData));
+ SYSFILE->m_restart_seq = tmp;
if (c_set_initial_start_flag)
{
@@ -1084,7 +1095,7 @@
jamEntry();
const ndb_mgm_configuration_iterator * p =
- theConfiguration.getOwnConfigIterator();
+ m_ctx.m_config.getOwnConfigIterator();
ndbrequireErr(p != 0, NDBD_EXIT_INVALID_CONFIG);
initData();
@@ -1127,6 +1138,26 @@
return;
}//Dbdih::execSTART_FRAGCONF()
+void Dbdih::execSTART_FRAGREF(Signal* signal)
+{
+ jamEntry();
+
+ /**
+ * Kill starting node
+ */
+ Uint32 errCode = signal->theData[1];
+ Uint32 nodeId = signal->theData[2];
+
+ SystemError * const sysErr = (SystemError*)&signal->theData[0];
+ sysErr->errorCode = SystemError::StartFragRefError;
+ sysErr->errorRef = reference();
+ sysErr->data1 = errCode;
+ sysErr->data2 = 0;
+ sendSignal(calcNdbCntrBlockRef(nodeId), GSN_SYSTEM_ERROR, signal,
+ SystemError::SignalLength, JBB);
+ return;
+}//Dbdih::execSTART_FRAGCONF()
+
void Dbdih::execSTART_MEREF(Signal* signal)
{
jamEntry();
@@ -1169,11 +1200,58 @@
void Dbdih::execDIH_RESTARTREQ(Signal* signal)
{
jamEntry();
- cntrlblockref = signal->theData[0];
- if(theConfiguration.getInitialStart()){
- sendSignal(cntrlblockref, GSN_DIH_RESTARTREF, signal, 1, JBB);
- } else {
- readGciFileLab(signal);
+ if (signal->theData[0])
+ {
+ jam();
+ cntrlblockref = signal->theData[0];
+ if(m_ctx.m_config.getInitialStart()){
+ sendSignal(cntrlblockref, GSN_DIH_RESTARTREF, signal, 1, JBB);
+ } else {
+ readGciFileLab(signal);
+ }
+ }
+ else
+ {
+ /**
+ * Precondition, (not checked)
+ * atleast 1 node in each node group
+ */
+ Uint32 i;
+ NdbNodeBitmask mask;
+ mask.assign(NdbNodeBitmask::Size, signal->theData + 1);
+ Uint32 *node_gcis = signal->theData+1+NdbNodeBitmask::Size;
+ Uint32 node_group_gcis[MAX_NDB_NODES+1];
+ bzero(node_group_gcis, sizeof(node_group_gcis));
+ for (i = 0; i<MAX_NDB_NODES; i++)
+ {
+ if (mask.get(i))
+ {
+ jam();
+ Uint32 ng = Sysfile::getNodeGroup(i, SYSFILE->nodeGroups);
+ ndbrequire(ng < MAX_NDB_NODES);
+ Uint32 gci = node_gcis[i];
+ if (gci > node_group_gcis[ng])
+ {
+ jam();
+ node_group_gcis[ng] = gci;
+ }
+ }
+ }
+ for (i = 0; i<MAX_NDB_NODES && node_group_gcis[i] == 0; i++);
+
+ Uint32 gci = node_group_gcis[i];
+ for (i++ ; i<MAX_NDB_NODES; i++)
+ {
+ jam();
+ if (node_group_gcis[i] && node_group_gcis[i] != gci)
+ {
+ jam();
+ signal->theData[0] = i;
+ return;
+ }
+ }
+ signal->theData[0] = MAX_NDB_NODES;
+ return;
}
return;
}//Dbdih::execDIH_RESTARTREQ()
@@ -1505,10 +1583,26 @@
*/
SYSFILE->lastCompletedGCI[nodePtr.i] = 0;
ndbrequire(nodePtr.p->nodeStatus != NodeRecord::ALIVE);
- warningEvent("Making filesystem for node %d unusable",
+ warningEvent("Making filesystem for node %d unusable (need --initial)",
nodePtr.i);
}
+ else if (nodePtr.p->nodeStatus == NodeRecord::ALIVE &&
+ SYSFILE->lastCompletedGCI[nodePtr.i] == 0)
+ {
+ jam();
+ CRASH_INSERTION(7170);
+ char buf[255];
+ BaseString::snprintf(buf, sizeof(buf),
+ "Cluster requires this node to be started "
+ " with --initial as partial start has been performed"
+ " and this filesystem is unusable");
+ progError(__LINE__,
+ NDBD_EXIT_SR_RESTARTCONFLICT,
+ buf);
+ ndbrequire(false);
+ }
}
+
/**
* This set which GCI we will try to restart to
*/
@@ -1744,12 +1838,15 @@
*
* But dont copy lastCompletedGCI:s
*/
+ Uint32 key = SYSFILE->m_restart_seq;
Uint32 tempGCP[MAX_NDB_NODES];
for(i = 0; i < MAX_NDB_NODES; i++)
tempGCP[i] = SYSFILE->lastCompletedGCI[i];
for(i = 0; i < Sysfile::SYSFILE_SIZE32; i++)
sysfileData[i] = cdata[i];
+
+ SYSFILE->m_restart_seq = key;
for(i = 0; i < MAX_NDB_NODES; i++)
SYSFILE->lastCompletedGCI[i] = tempGCP[i];
@@ -1907,11 +2004,6 @@
ndbrequire(c_nodeStartMaster.startNode == Tnodeid);
ndbrequire(getNodeStatus(Tnodeid) == NodeRecord::STARTING);
- sendSTART_RECREQ(signal, Tnodeid);
-}//Dbdih::execSTART_MEREQ()
-
-void Dbdih::nodeRestartStartRecConfLab(Signal* signal)
-{
c_nodeStartMaster.blockLcp = true;
if ((c_lcpState.lcpStatus != LCP_STATUS_IDLE) &&
(c_lcpState.lcpStatus != LCP_TCGET)) {
@@ -2006,8 +2098,11 @@
/*-------------------------------------------------------------------------*/
Uint32 startVersion = getNodeInfo(c_nodeStartMaster.startNode).m_version;
- if ((getMajor(startVersion) == 4 && startVersion >=
NDBD_INCL_NODECONF_VERSION_4) ||
- (getMajor(startVersion) == 5 && startVersion >=
NDBD_INCL_NODECONF_VERSION_5))
+ if ((getMajor(startVersion) == 4 &&
+ startVersion >= NDBD_INCL_NODECONF_VERSION_4) ||
+ (getMajor(startVersion) == 5 &&
+ startVersion >= NDBD_INCL_NODECONF_VERSION_5) ||
+ (getMajor(startVersion) > 5))
{
c_INCL_NODEREQ_Counter.setWaitingFor(c_nodeStartMaster.startNode);
}
@@ -2058,6 +2153,9 @@
signal->theData[0] = reference();
signal->theData[1] = c_nodeStartSlave.nodeId;
sendSignal(BACKUP_REF, GSN_INCL_NODEREQ, signal, 2, JBB);
+
+ // Suma will not send response to this for now, later...
+ sendSignal(SUMA_REF, GSN_INCL_NODEREQ, signal, 2, JBB);
return;
}//if
if (TstartNode_or_blockref == numberToRef(BACKUP, getOwnNodeId())){
@@ -2247,8 +2345,11 @@
CRASH_INSERTION(7171);
Uint32 masterVersion = getNodeInfo(refToNode(cmasterdihref)).m_version;
- if ((NDB_VERSION_MAJOR == 4 && masterVersion >=
NDBD_INCL_NODECONF_VERSION_4) ||
- (NDB_VERSION_MAJOR == 5 && masterVersion >= NDBD_INCL_NODECONF_VERSION_5))
+ if ((NDB_VERSION_MAJOR == 4 &&
+ masterVersion >= NDBD_INCL_NODECONF_VERSION_4) ||
+ (NDB_VERSION_MAJOR == 5 &&
+ masterVersion >= NDBD_INCL_NODECONF_VERSION_5) ||
+ (NDB_VERSION_MAJOR > 5))
{
signal->theData[0] = getOwnNodeId();
signal->theData[1] = getOwnNodeId();
@@ -2734,13 +2835,14 @@
return;
}//if
c_startToLock = takeOverPtrI;
+
+ takeOverPtr.p->toMasterStatus = TakeOverRecord::STARTING;
StartToReq * const req = (StartToReq *)&signal->theData[0];
req->userPtr = takeOverPtr.i;
req->userRef = reference();
req->startingNodeId = takeOverPtr.p->toStartingNode;
req->nodeTakenOver = takeOverPtr.p->toFailedNode;
req->nodeRestart = takeOverPtr.p->toNodeRestart;
- takeOverPtr.p->toMasterStatus = TakeOverRecord::STARTING;
sendLoopMacro(START_TOREQ, sendSTART_TOREQ);
}//Dbdih::sendStartTo()
@@ -2784,9 +2886,165 @@
CRASH_INSERTION(7134);
c_startToLock = RNIL;
+ if (takeOverPtr.p->toNodeRestart)
+ {
+ jam();
+ takeOverPtr.p->toMasterStatus = TakeOverRecord::STARTING_LOCAL_FRAGMENTS;
+ nr_start_fragments(signal, takeOverPtr);
+ return;
+ }
+
startNextCopyFragment(signal, takeOverPtr.i);
}//Dbdih::execSTART_TOCONF()
+void
+Dbdih::nr_start_fragments(Signal* signal,
+ TakeOverRecordPtr takeOverPtr)
+{
+ Uint32 loopCount = 0 ;
+ TabRecordPtr tabPtr;
+ while (loopCount++ < 100) {
+ tabPtr.i = takeOverPtr.p->toCurrentTabref;
+ if (tabPtr.i >= ctabFileSize) {
+ jam();
+ nr_run_redo(signal, takeOverPtr);
+ return;
+ }//if
+ ptrAss(tabPtr, tabRecord);
+ if (tabPtr.p->tabStatus != TabRecord::TS_ACTIVE ||
+ tabPtr.p->tabStorage != TabRecord::ST_NORMAL)
+ {
+ jam();
+ takeOverPtr.p->toCurrentFragid = 0;
+ takeOverPtr.p->toCurrentTabref++;
+ continue;
+ }//if
+ Uint32 fragId = takeOverPtr.p->toCurrentFragid;
+ if (fragId >= tabPtr.p->totalfragments) {
+ jam();
+ takeOverPtr.p->toCurrentFragid = 0;
+ takeOverPtr.p->toCurrentTabref++;
+ continue;
+ }//if
+ FragmentstorePtr fragPtr;
+ getFragstore(tabPtr.p, fragId, fragPtr);
+ ReplicaRecordPtr loopReplicaPtr;
+ loopReplicaPtr.i = fragPtr.p->oldStoredReplicas;
+ while (loopReplicaPtr.i != RNIL) {
+ ptrCheckGuard(loopReplicaPtr, creplicaFileSize, replicaRecord);
+ if (loopReplicaPtr.p->procNode == takeOverPtr.p->toStartingNode) {
+ jam();
+ nr_start_fragment(signal, takeOverPtr, loopReplicaPtr);
+ break;
+ } else {
+ jam();
+ loopReplicaPtr.i = loopReplicaPtr.p->nextReplica;
+ }//if
+ }//while
+ takeOverPtr.p->toCurrentFragid++;
+ }//while
+ signal->theData[0] = DihContinueB::ZTO_START_FRAGMENTS;
+ signal->theData[1] = takeOverPtr.i;
+ sendSignal(reference(), GSN_CONTINUEB, signal, 2, JBB);
+}
+
+void
+Dbdih::nr_start_fragment(Signal* signal,
+ TakeOverRecordPtr takeOverPtr,
+ ReplicaRecordPtr replicaPtr)
+{
+ Uint32 i, j = 0;
+ Uint32 maxLcpId = 0;
+ Uint32 maxLcpIndex = ~0;
+
+ Uint32 restorableGCI = 0;
+
+ ndbout_c("tab: %d frag: %d replicaP->nextLcp: %d",
+ takeOverPtr.p->toCurrentTabref,
+ takeOverPtr.p->toCurrentFragid,
+ replicaPtr.p->nextLcp);
+
+ Uint32 idx = replicaPtr.p->nextLcp;
+ for(i = 0; i<MAX_LCP_STORED; i++, idx = nextLcpNo(idx))
+ {
+ ndbout_c("scanning idx: %d lcpId: %d", idx, replicaPtr.p->lcpId[idx]);
+ if (replicaPtr.p->lcpStatus[idx] == ZVALID)
+ {
+ ndbrequire(replicaPtr.p->lcpId[idx] > maxLcpId);
+ Uint32 stopGci = replicaPtr.p->maxGciStarted[idx];
+ for (;j < replicaPtr.p->noCrashedReplicas; j++)
+ {
+ ndbout_c("crashed replica: %d(%d) replicaLastGci: %d",
+ j,
+ replicaPtr.p->noCrashedReplicas,
+ replicaPtr.p->replicaLastGci[j]);
+ if (replicaPtr.p->replicaLastGci[j] > stopGci)
+ {
+ maxLcpId = replicaPtr.p->lcpId[idx];
+ maxLcpIndex = idx;
+ restorableGCI = replicaPtr.p->replicaLastGci[j];
+ break;
+ }
+ }
+ }
+ }
+
+ if (maxLcpIndex == ~ (Uint32) 0)
+ {
+ ndbout_c("Didnt find any LCP for node: %d tab: %d frag: %d",
+ takeOverPtr.p->toStartingNode,
+ takeOverPtr.p->toCurrentTabref,
+ takeOverPtr.p->toCurrentFragid);
+ replicaPtr.p->lcpIdStarted = 0;
+ BlockReference ref = calcLqhBlockRef(takeOverPtr.p->toStartingNode);
+ StartFragReq *req = (StartFragReq *)signal->getDataPtrSend();
+ req->userPtr = 0;
+ req->userRef = reference();
+ req->lcpNo = ZNIL;
+ req->lcpId = 0;
+ req->tableId = takeOverPtr.p->toCurrentTabref;
+ req->fragId = takeOverPtr.p->toCurrentFragid;
+ req->noOfLogNodes = 0;
+ sendSignal(ref, GSN_START_FRAGREQ, signal,
+ StartFragReq::SignalLength, JBB);
+ }
+ else
+ {
+ ndbout_c("Found LCP: %d(%d) maxGciStarted: %d maxGciCompleted: %d restorable: %d(%d)
newestRestorableGCI: %d",
+ maxLcpId,
+ maxLcpIndex,
+ replicaPtr.p->maxGciStarted[maxLcpIndex],
+ replicaPtr.p->maxGciCompleted[maxLcpIndex],
+ restorableGCI,
+ SYSFILE->lastCompletedGCI[takeOverPtr.p->toStartingNode],
+ SYSFILE->newestRestorableGCI);
+
+ replicaPtr.p->lcpIdStarted = restorableGCI;
+ BlockReference ref = calcLqhBlockRef(takeOverPtr.p->toStartingNode);
+ StartFragReq *req = (StartFragReq *)signal->getDataPtrSend();
+ req->userPtr = 0;
+ req->userRef = reference();
+ req->lcpNo = maxLcpIndex;
+ req->lcpId = maxLcpId;
+ req->tableId = takeOverPtr.p->toCurrentTabref;
+ req->fragId = takeOverPtr.p->toCurrentFragid;
+ req->noOfLogNodes = 1;
+ req->lqhLogNode[0] = takeOverPtr.p->toStartingNode;
+ req->startGci[0] = replicaPtr.p->maxGciCompleted[maxLcpIndex];
+ req->lastGci[0] = restorableGCI;
+ sendSignal(ref, GSN_START_FRAGREQ, signal,
+ StartFragReq::SignalLength, JBB);
+ }
+}
+
+void
+Dbdih::nr_run_redo(Signal* signal, TakeOverRecordPtr takeOverPtr)
+{
+ takeOverPtr.p->toCurrentTabref = 0;
+ takeOverPtr.p->toCurrentFragid = 0;
+ sendSTART_RECREQ(signal, takeOverPtr.p->toStartingNode);
+}
+
void Dbdih::initStartTakeOver(const StartToReq * req,
TakeOverRecordPtr takeOverPtr)
{
@@ -3119,6 +3377,14 @@
/*---------------------------------------------------------------------- */
FragmentstorePtr fragPtr;
getFragstore(tabPtr.p, fragId, fragPtr);
+ Uint32 gci = 0;
+ if (takeOverPtr.p->toNodeRestart)
+ {
+ ReplicaRecordPtr replicaPtr;
+ findReplica(replicaPtr, fragPtr.p, takeOverPtr.p->toStartingNode, true);
+ gci = replicaPtr.p->lcpIdStarted;
+ replicaPtr.p->lcpIdStarted = 0;
+ }
takeOverPtr.p->toMasterStatus = TakeOverRecord::COPY_FRAG;
BlockReference ref = calcLqhBlockRef(takeOverPtr.p->toCopyNode);
CopyFragReq * const copyFragReq = (CopyFragReq *)&signal->theData[0];
@@ -3129,6 +3395,7 @@
copyFragReq->nodeId = takeOverPtr.p->toStartingNode;
copyFragReq->schemaVersion = tabPtr.p->schemaVersion;
copyFragReq->distributionKey = fragPtr.p->distributionKey;
+ copyFragReq->gci = gci;
copyFragReq->nodeCount = extractNodeInfo(fragPtr.p,
copyFragReq->nodeList);
sendSignal(ref, GSN_COPY_FRAGREQ, signal,
@@ -3661,6 +3928,7 @@
/* WE ALSO COPY TO OUR OWN NODE. TO ENABLE US TO DO THIS PROPERLY WE */
/* START BY CLOSING THIS FILE. */
/* ----------------------------------------------------------------------- */
+ globalData.m_restart_seq = ++SYSFILE->m_restart_seq;
closeFile(signal, filePtr);
filePtr.p->reqStatus = FileRecord::CLOSING_GCP;
}//Dbdih::readingGcpLab()
@@ -3869,6 +4137,11 @@
Uint32 newMasterId = nodeFail->masterNodeId;
const Uint32 noOfFailedNodes = nodeFail->noOfNodes;
+ if (ERROR_INSERTED(7179))
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+
/*-------------------------------------------------------------------------*/
// The first step is to convert from a bit mask to an array of failed nodes.
/*-------------------------------------------------------------------------*/
@@ -4179,6 +4452,8 @@
Uint32 takeOverPtrI)
{
jam();
+ ndbout_c("checkTakeOverInMasterStartNodeFailure %x",
+ takeOverPtrI);
if (takeOverPtrI == RNIL) {
jam();
return;
@@ -4192,6 +4467,9 @@
takeOverPtr.i = takeOverPtrI;
ptrCheckGuard(takeOverPtr, MAX_NDB_NODES, takeOverRecord);
+ ndbout_c("takeOverPtr.p->toMasterStatus: %x",
+ takeOverPtr.p->toMasterStatus);
+
bool ok = false;
switch (takeOverPtr.p->toMasterStatus) {
case TakeOverRecord::IDLE:
@@ -4300,6 +4578,13 @@
//-----------------------------------------------------------------------
endTakeOver(takeOverPtr.i);
break;
+
+ case TakeOverRecord::STARTING_LOCAL_FRAGMENTS:
+ ok = true;
+ jam();
+ endTakeOver(takeOverPtr.i);
+ break;
+
/**
* The following are states that it should not be possible to "be" in
*/
@@ -5407,7 +5692,7 @@
//const Uint32 lcpId = SYSFILE->latestLCP_ID;
const bool lcpOngoingFlag = (tabPtr.p->tabLcpStatus== TabRecord::TLS_ACTIVE);
- const bool temporary = !tabPtr.p->storedTable;
+ const bool unlogged = (tabPtr.p->tabStorage != TabRecord::ST_NORMAL);
FragmentstorePtr fragPtr;
for(Uint32 fragNo = 0; fragNo < tabPtr.p->totalfragments; fragNo++){
@@ -5428,7 +5713,7 @@
jam();
found = true;
noOfRemovedReplicas++;
- removeNodeFromStored(nodeId, fragPtr, replicaPtr, temporary);
+ removeNodeFromStored(nodeId, fragPtr, replicaPtr, unlogged);
if(replicaPtr.p->lcpOngoingFlag){
jam();
/**
@@ -5763,11 +6048,9 @@
#endif
}
- bool ok = false;
MasterLCPConf::State lcpState;
switch (c_lcpState.lcpStatus) {
case LCP_STATUS_IDLE:
- ok = true;
jam();
/*------------------------------------------------*/
/* LOCAL CHECKPOINT IS CURRENTLY NOT ACTIVE */
@@ -5778,7 +6061,6 @@
lcpState = MasterLCPConf::LCP_STATUS_IDLE;
break;
case LCP_STATUS_ACTIVE:
- ok = true;
jam();
/*--------------------------------------------------*/
/* COPY OF RESTART INFORMATION HAS BEEN */
@@ -5787,7 +6069,6 @@
lcpState = MasterLCPConf::LCP_STATUS_ACTIVE;
break;
case LCP_TAB_COMPLETED:
- ok = true;
jam();
/*--------------------------------------------------------*/
/* ALL LCP_REPORT'S HAVE BEEN COMPLETED FOR */
@@ -5797,7 +6078,6 @@
lcpState = MasterLCPConf::LCP_TAB_COMPLETED;
break;
case LCP_TAB_SAVED:
- ok = true;
jam();
/*--------------------------------------------------------*/
/* ALL LCP_REPORT'S HAVE BEEN COMPLETED FOR */
@@ -5821,15 +6101,16 @@
break;
case LCP_COPY_GCI:
case LCP_INIT_TABLES:
- ok = true;
/**
* These two states are handled by if statements above
*/
ndbrequire(false);
lcpState= MasterLCPConf::LCP_STATUS_IDLE; // remove warning
break;
+ default:
+ ndbrequire(false);
+ lcpState= MasterLCPConf::LCP_STATUS_IDLE; // remove warning
}//switch
- ndbrequire(ok);
Uint32 failedNodeId = c_lcpState.m_MASTER_LCPREQ_FailedNodeId;
MasterLCPConf * const conf = (MasterLCPConf *)&signal->theData[0];
@@ -6429,96 +6710,147 @@
3.7.1 A D D T A B L E M A I N L Y
***************************************
*/
-void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal){
+
+static inline void inc_node_or_group(Uint32 &node, Uint32 max_node)
+{
+ Uint32 next = node + 1;
+ node = (next == max_node ? 0 : next);
+}
+
+/*
+ Spread fragments in backwards compatible mode
+*/
+static void set_default_node_groups(Signal *signal, Uint32 noFrags)
+{
+ Uint16 *node_group_array = (Uint16*)&signal->theData[25];
+ Uint32 i;
+ node_group_array[0] = 0;
+ for (i = 1; i < noFrags; i++)
+ node_group_array[i] = UNDEF_NODEGROUP;
+}
+void Dbdih::execCREATE_FRAGMENTATION_REQ(Signal * signal)
+{
+ Uint16 node_group_id[MAX_NDB_PARTITIONS];
jamEntry();
CreateFragmentationReq * const req =
(CreateFragmentationReq*)signal->getDataPtr();
const Uint32 senderRef = req->senderRef;
const Uint32 senderData = req->senderData;
- const Uint32 fragmentNode = req->fragmentNode;
- const Uint32 fragmentType = req->fragmentationType;
- //const Uint32 fragmentCount = req->noOfFragments;
+ Uint32 noOfFragments = req->noOfFragments;
+ const Uint32 fragType = req->fragmentationType;
const Uint32 primaryTableId = req->primaryTableId;
Uint32 err = 0;
do {
- Uint32 noOfFragments = 0;
- Uint32 noOfReplicas = cnoReplicas;
- switch(fragmentType){
- case DictTabInfo::AllNodesSmallTable:
- jam();
- noOfFragments = csystemnodes;
- break;
- case DictTabInfo::AllNodesMediumTable:
- jam();
- noOfFragments = 2 * csystemnodes;
- break;
- case DictTabInfo::AllNodesLargeTable:
- jam();
- noOfFragments = 4 * csystemnodes;
- break;
- case DictTabInfo::SingleFragment:
- jam();
- noOfFragments = 1;
- break;
-#if 0
- case DictTabInfo::SpecifiedFragmentCount:
- noOfFragments = (fragmentCount == 0 ? 1 : (fragmentCount + 1)/ 2);
- break;
-#endif
- default:
- jam();
- err = CreateFragmentationRef::InvalidFragmentationType;
- break;
- }
- if(err)
- break;
-
NodeGroupRecordPtr NGPtr;
TabRecordPtr primTabPtr;
+ Uint32 count = 2;
+ Uint16 noOfReplicas = cnoReplicas;
+ Uint16 *fragments = (Uint16*)(signal->theData+25);
if (primaryTableId == RNIL) {
- if(fragmentNode == 0){
- jam();
- NGPtr.i = 0;
- if(noOfFragments < csystemnodes)
- {
- NGPtr.i = c_nextNodeGroup;
- c_nextNodeGroup = (NGPtr.i + 1 == cnoOfNodeGroups ? 0 : NGPtr.i + 1);
- }
- } else if(! (fragmentNode < MAX_NDB_NODES)) {
- jam();
- err = CreateFragmentationRef::InvalidNodeId;
- } else {
- jam();
- const Uint32 stat = Sysfile::getNodeStatus(fragmentNode,
- SYSFILE->nodeStatus);
- switch (stat) {
- case Sysfile::NS_Active:
- case Sysfile::NS_ActiveMissed_1:
- case Sysfile::NS_ActiveMissed_2:
- case Sysfile::NS_TakeOver:
+ jam();
+ switch ((DictTabInfo::FragmentType)fragType)
+ {
+ /*
+ Backward compatability and for all places in code not changed.
+ */
+ case DictTabInfo::AllNodesSmallTable:
jam();
+ noOfFragments = csystemnodes;
+ set_default_node_groups(signal, noOfFragments);
break;
- case Sysfile::NS_NotActive_NotTakenOver:
+ case DictTabInfo::AllNodesMediumTable:
jam();
+ noOfFragments = 2 * csystemnodes;
+ set_default_node_groups(signal, noOfFragments);
break;
- case Sysfile::NS_HotSpare:
+ case DictTabInfo::AllNodesLargeTable:
jam();
- case Sysfile::NS_NotDefined:
+ noOfFragments = 4 * csystemnodes;
+ set_default_node_groups(signal, noOfFragments);
+ break;
+ case DictTabInfo::SingleFragment:
jam();
+ noOfFragments = 1;
+ set_default_node_groups(signal, noOfFragments);
+ break;
+ case DictTabInfo::DistrKeyHash:
+ jam();
+ case DictTabInfo::DistrKeyLin:
+ jam();
+ if (noOfFragments == 0)
+ {
+ jam();
+ noOfFragments = csystemnodes;
+ set_default_node_groups(signal, noOfFragments);
+ }
+ break;
default:
jam();
- err = CreateFragmentationRef::InvalidNodeType;
+ if (noOfFragments == 0)
+ {
+ jam();
+ err = CreateFragmentationRef::InvalidFragmentationType;
+ }
break;
+ }
+ if (err)
+ break;
+ /*
+ When we come here the the exact partition is specified
+ and there is an array of node groups sent along as well.
+ */
+ memcpy(&node_group_id[0], &signal->theData[25], 2 * noOfFragments);
+ Uint16 next_replica_node[MAX_NDB_NODES];
+ memset(next_replica_node,0,sizeof(next_replica_node));
+ Uint32 default_node_group= c_nextNodeGroup;
+ for(Uint32 fragNo = 0; fragNo < noOfFragments; fragNo++)
+ {
+ jam();
+ NGPtr.i = node_group_id[fragNo];
+ if (NGPtr.i == UNDEF_NODEGROUP)
+ {
+ jam();
+ NGPtr.i = default_node_group;
}
- if(err)
+ if (NGPtr.i > cnoOfNodeGroups)
+ {
+ jam();
+ err = CreateFragmentationRef::InvalidNodeGroup;
break;
- NGPtr.i = Sysfile::getNodeGroup(fragmentNode,
- SYSFILE->nodeGroups);
+ }
+ ptrCheckGuard(NGPtr, MAX_NDB_NODES, nodeGroupRecord);
+ const Uint32 max = NGPtr.p->nodeCount;
+
+ fragments[count++] = c_nextLogPart++; // Store logpart first
+ Uint32 tmp= next_replica_node[NGPtr.i];
+ for(Uint32 replicaNo = 0; replicaNo < noOfReplicas; replicaNo++)
+ {
+ jam();
+ const Uint16 nodeId = NGPtr.p->nodesInGroup[tmp];
+ fragments[count++]= nodeId;
+ inc_node_or_group(tmp, max);
+ }
+ inc_node_or_group(tmp, max);
+ next_replica_node[NGPtr.i]= tmp;
+
+ /**
+ * Next node group for next fragment
+ */
+ inc_node_or_group(default_node_group, cnoOfNodeGroups);
+ }
+ if (err)
+ {
+ jam();
break;
}
+ else
+ {
+ jam();
+ c_nextNodeGroup = default_node_group;
+ }
} else {
if (primaryTableId >= ctabFileSize) {
jam();
@@ -6532,48 +6864,14 @@
err = CreateFragmentationRef::InvalidPrimaryTable;
break;
}
- if (noOfFragments != primTabPtr.p->totalfragments) {
- jam();
- err = CreateFragmentationRef::InvalidFragmentationType;
- break;
- }
- }
-
- Uint32 count = 2;
- Uint16 *fragments = (Uint16*)(signal->theData+25);
- if (primaryTableId == RNIL) {
- jam();
- Uint8 next_replica_node[MAX_NDB_NODES];
- memset(next_replica_node,0,sizeof(next_replica_node));
- for(Uint32 fragNo = 0; fragNo<noOfFragments; fragNo++){
- jam();
- ptrCheckGuard(NGPtr, MAX_NDB_NODES, nodeGroupRecord);
- const Uint32 max = NGPtr.p->nodeCount;
-
- Uint32 tmp= next_replica_node[NGPtr.i];
- for(Uint32 replicaNo = 0; replicaNo<noOfReplicas; replicaNo++)
- {
- jam();
- const Uint32 nodeId = NGPtr.p->nodesInGroup[tmp++];
- fragments[count++] = nodeId;
- tmp = (tmp >= max ? 0 : tmp);
- }
- tmp++;
- next_replica_node[NGPtr.i]= (tmp >= max ? 0 : tmp);
-
- /**
- * Next node group for next fragment
- */
- NGPtr.i++;
- NGPtr.i = (NGPtr.i == cnoOfNodeGroups ? 0 : NGPtr.i);
- }
- } else {
+ noOfFragments= primTabPtr.p->totalfragments;
for (Uint32 fragNo = 0;
- fragNo < primTabPtr.p->totalfragments; fragNo++) {
+ fragNo < noOfFragments; fragNo++) {
jam();
FragmentstorePtr fragPtr;
ReplicaRecordPtr replicaPtr;
getFragstore(primTabPtr.p, fragNo, fragPtr);
+ fragments[count++] = fragPtr.p->m_log_part_id;
fragments[count++] = fragPtr.p->preferredPrimary;
for (replicaPtr.i = fragPtr.p->storedReplicas;
replicaPtr.i != RNIL;
@@ -6582,9 +6880,9 @@
ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
if (replicaPtr.p->procNode != fragPtr.p->preferredPrimary) {
jam();
- fragments[count++] = replicaPtr.p->procNode;
- }//if
- }//for
+ fragments[count++]= replicaPtr.p->procNode;
+ }
+ }
for (replicaPtr.i = fragPtr.p->oldStoredReplicas;
replicaPtr.i != RNIL;
replicaPtr.i = replicaPtr.p->nextReplica) {
@@ -6592,12 +6890,12 @@
ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
if (replicaPtr.p->procNode != fragPtr.p->preferredPrimary) {
jam();
- fragments[count++] = replicaPtr.p->procNode;
- }//if
- }//for
+ fragments[count++]= replicaPtr.p->procNode;
+ }
+ }
}
}
- if(count != (2 + noOfReplicas * noOfFragments)){
+ if(count != (2U + (1 + noOfReplicas) * noOfFragments)){
char buf[255];
BaseString::snprintf(buf, sizeof(buf),
"Illegal configuration change: NoOfReplicas."
@@ -6609,14 +6907,15 @@
(CreateFragmentationConf*)signal->getDataPtrSend();
conf->senderRef = reference();
conf->senderData = senderData;
- conf->noOfReplicas = noOfReplicas;
- conf->noOfFragments = noOfFragments;
+ conf->noOfReplicas = (Uint32)noOfReplicas;
+ conf->noOfFragments = (Uint32)noOfFragments;
- fragments[0] = noOfReplicas;
- fragments[1] = noOfFragments;
+ fragments[0]= noOfReplicas;
+ fragments[1]= noOfFragments;
if(senderRef != 0)
{
+ jam();
LinearSectionPtr ptr[3];
ptr[0].p = (Uint32*)&fragments[0];
ptr[0].sz = (count + 1) / 2;
@@ -6628,33 +6927,17 @@
ptr,
1);
}
- else
- {
- // Execute direct
- signal->theData[0] = 0;
- }
+ // Always ACK/NACK (here ACK)
+ signal->theData[0] = 0;
return;
} while(false);
-
- if(senderRef != 0)
- {
- CreateFragmentationRef * const ref =
- (CreateFragmentationRef*)signal->getDataPtrSend();
- ref->senderRef = reference();
- ref->senderData = senderData;
- ref->errorCode = err;
- sendSignal(senderRef, GSN_CREATE_FRAGMENTATION_REF, signal,
- CreateFragmentationRef::SignalLength, JBB);
- }
- else
- {
- // Execute direct
- signal->theData[0] = err;
- }
+ // Always ACK/NACK (here NACK)
+ signal->theData[0] = err;
}
void Dbdih::execDIADDTABREQ(Signal* signal)
{
+ Uint32 fragType;
jamEntry();
DiAddTabReq * const req = (DiAddTabReq*)signal->getDataPtr();
@@ -6679,6 +6962,7 @@
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
tabPtr.p->connectrec = connectPtr.i;
tabPtr.p->tableType = req->tableType;
+ fragType= req->fragType;
tabPtr.p->schemaVersion = req->schemaVersion;
tabPtr.p->primaryTableId = req->primaryTableId;
@@ -6714,15 +6998,46 @@
/* BUT THEY DO NOT HAVE ANY INFORMATION ABOUT ANY TABLE*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
tabPtr.p->tabStatus = TabRecord::TS_CREATING;
- tabPtr.p->storedTable = req->storedTable;
- tabPtr.p->method = TabRecord::HASH;
+ if(req->loggedTable)
+ tabPtr.p->tabStorage= TabRecord::ST_NORMAL;
+ else if(req->temporaryTable)
+ tabPtr.p->tabStorage= TabRecord::ST_TEMPORARY;
+ else
+ tabPtr.p->tabStorage= TabRecord::ST_NOLOGGING;
tabPtr.p->kvalue = req->kValue;
+ switch ((DictTabInfo::FragmentType)fragType)
+ {
+ case DictTabInfo::AllNodesSmallTable:
+ case DictTabInfo::AllNodesMediumTable:
+ case DictTabInfo::AllNodesLargeTable:
+ case DictTabInfo::SingleFragment:
+ jam();
+ case DictTabInfo::DistrKeyLin:
+ jam();
+ tabPtr.p->method= TabRecord::LINEAR_HASH;
+ break;
+ case DictTabInfo::DistrKeyHash:
+ case DictTabInfo::DistrKeyUniqueHashIndex:
+ case DictTabInfo::DistrKeyOrderedIndex:
+ jam();
+ tabPtr.p->method= TabRecord::NORMAL_HASH;
+ break;
+ case DictTabInfo::UserDefined:
+ jam();
+ tabPtr.p->method= TabRecord::USER_DEFINED;
+ break;
+ default:
+ ndbrequire(false);
+ }
+
union {
Uint16 fragments[2 + MAX_FRAG_PER_NODE*MAX_REPLICAS*MAX_NDB_NODES];
Uint32 align;
};
SegmentedSectionPtr fragDataPtr;
+ LINT_INIT(fragDataPtr.i);
+ LINT_INIT(fragDataPtr.sz);
signal->getSection(fragDataPtr, DiAddTabReq::FRAGMENTATION);
copy((Uint32*)fragments, fragDataPtr);
releaseSections(signal);
@@ -6766,7 +7081,9 @@
FragmentstorePtr fragPtr;
Uint32 activeIndex = 0;
getFragstore(tabPtr.p, fragId, fragPtr);
+ fragPtr.p->m_log_part_id = fragments[index++];
fragPtr.p->preferredPrimary = fragments[index];
+
for (Uint32 i = 0; i<noReplicas; i++) {
const Uint32 nodeId = fragments[index++];
ReplicaRecordPtr replicaPtr;
@@ -6810,10 +7127,12 @@
TabRecordPtr tabPtr, Uint32 fragId){
jam();
const Uint32 fragCount = tabPtr.p->totalfragments;
- ReplicaRecordPtr replicaPtr; replicaPtr.i = RNIL;
+ ReplicaRecordPtr replicaPtr;
+ LINT_INIT(replicaPtr.p);
+ replicaPtr.i = RNIL;
+ FragmentstorePtr fragPtr;
for(; fragId<fragCount; fragId++){
jam();
- FragmentstorePtr fragPtr;
getFragstore(tabPtr.p, fragId, fragPtr);
replicaPtr.i = fragPtr.p->storedReplicas;
@@ -6853,7 +7172,7 @@
ndbrequire(replicaPtr.p->procNode == getOwnNodeId());
Uint32 requestInfo = 0;
- if(!tabPtr.p->storedTable){
+ if(tabPtr.p->tabStorage != TabRecord::ST_NORMAL){
requestInfo |= LqhFragReq::TemporaryTable;
}
@@ -6871,6 +7190,7 @@
req->nodeId = getOwnNodeId();
req->totalFragments = fragCount;
req->startGci = SYSFILE->newestRestorableGCI;
+ req->logPartId = fragPtr.p->m_log_part_id;
sendSignal(DBDICT_REF, GSN_ADD_FRAGREQ, signal,
AddFragReq::SignalLength, JBB);
return;
@@ -7152,17 +7472,40 @@
tabPtr.i = req->tableId;
Uint32 hashValue = req->hashValue;
Uint32 ttabFileSize = ctabFileSize;
+ Uint32 fragId;
+ DiGetNodesConf * const conf = (DiGetNodesConf *)&signal->theData[0];
TabRecord* regTabDesc = tabRecord;
jamEntry();
ptrCheckGuard(tabPtr, ttabFileSize, regTabDesc);
- Uint32 fragId = hashValue & tabPtr.p->mask;
- ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE);
- if (fragId < tabPtr.p->hashpointer) {
+ if (tabPtr.p->method == TabRecord::LINEAR_HASH)
+ {
jam();
- fragId = hashValue & ((tabPtr.p->mask << 1) + 1);
- }//if
+ fragId = hashValue & tabPtr.p->mask;
+ ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE);
+ if (fragId < tabPtr.p->hashpointer) {
+ jam();
+ fragId = hashValue & ((tabPtr.p->mask << 1) + 1);
+ }//if
+ }
+ else if (tabPtr.p->method == TabRecord::NORMAL_HASH)
+ {
+ jam();
+ fragId= hashValue % tabPtr.p->totalfragments;
+ }
+ else
+ {
+ jam();
+ ndbassert(tabPtr.p->method == TabRecord::USER_DEFINED);
+ fragId= hashValue;
+ if (fragId >= tabPtr.p->totalfragments)
+ {
+ jam();
+ conf->zero= 1; //Indicate error;
+ signal->theData[1]= ZUNDEFINED_FRAGMENT_ERROR;
+ return;
+ }
+ }
getFragstore(tabPtr.p, fragId, fragPtr);
- DiGetNodesConf * const conf = (DiGetNodesConf *)&signal->theData[0];
Uint32 nodeCount = extractNodeInfo(fragPtr.p, conf->nodes);
Uint32 sig2 = (nodeCount - 1) +
(fragPtr.p->distributionKey << 16);
@@ -7329,39 +7672,70 @@
void Dbdih::execDI_FCOUNTREQ(Signal* signal)
{
+ DihFragCountReq * const req = (DihFragCountReq*)signal->getDataPtr();
ConnectRecordPtr connectPtr;
TabRecordPtr tabPtr;
+ const BlockReference senderRef = signal->senderBlockRef();
+ const Uint32 senderData = req->m_senderData;
jamEntry();
- connectPtr.i = signal->theData[0];
- tabPtr.i = signal->theData[1];
+ connectPtr.i = req->m_connectionData;
+ tabPtr.i = req->m_tableRef;
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
- ndbrequire(tabPtr.p->tabStatus == TabRecord::TS_ACTIVE);
+ if (tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
+ {
+ DihFragCountRef* ref = (DihFragCountRef*)signal->getDataPtrSend();
+ //connectPtr.i == RNIL -> question without connect record
+ if(connectPtr.i == RNIL)
+ ref->m_connectionData = RNIL;
+ else
+ {
+ jam();
+ ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord);
+ ref->m_connectionData = connectPtr.p->userpointer;
+ }
+ ref->m_tableRef = tabPtr.i;
+ ref->m_senderData = senderData;
+ ref->m_error = DihFragCountRef::ErroneousTableState;
+ ref->m_tableStatus = tabPtr.p->tabStatus;
+ sendSignal(senderRef, GSN_DI_FCOUNTREF, signal,
+ DihFragCountRef::SignalLength, JBB);
+ return;
+ }
if(connectPtr.i != RNIL){
ptrCheckGuard(connectPtr, cconnectFileSize, connectRecord);
if (connectPtr.p->connectState == ConnectRecord::INUSE) {
jam();
- signal->theData[0] = connectPtr.p->userpointer;
- signal->theData[1] = tabPtr.p->totalfragments;
- sendSignal(connectPtr.p->userblockref, GSN_DI_FCOUNTCONF, signal,2, JBB);
- return;
- }//if
- signal->theData[0] = connectPtr.p->userpointer;
- signal->theData[1] = ZERRONOUSSTATE;
- sendSignal(connectPtr.p->userblockref, GSN_DI_FCOUNTREF, signal, 2, JBB);
+ DihFragCountConf* conf = (DihFragCountConf*)signal->getDataPtrSend();
+ conf->m_connectionData = connectPtr.p->userpointer;
+ conf->m_tableRef = tabPtr.i;
+ conf->m_senderData = senderData;
+ conf->m_fragmentCount = tabPtr.p->totalfragments;
+ conf->m_noOfBackups = tabPtr.p->noOfBackups;
+ sendSignal(connectPtr.p->userblockref, GSN_DI_FCOUNTCONF, signal,
+ DihFragCountConf::SignalLength, JBB);
+ return;
+ }//if
+ DihFragCountRef* ref = (DihFragCountRef*)signal->getDataPtrSend();
+ ref->m_connectionData = connectPtr.p->userpointer;
+ ref->m_tableRef = tabPtr.i;
+ ref->m_senderData = senderData;
+ ref->m_error = DihFragCountRef::ErroneousTableState;
+ ref->m_tableStatus = tabPtr.p->tabStatus;
+ sendSignal(connectPtr.p->userblockref, GSN_DI_FCOUNTREF, signal,
+ DihFragCountRef::SignalLength, JBB);
return;
}//if
-
+ DihFragCountConf* conf = (DihFragCountConf*)signal->getDataPtrSend();
//connectPtr.i == RNIL -> question without connect record
- const Uint32 senderData = signal->theData[2];
- const BlockReference senderRef = signal->senderBlockRef();
- signal->theData[0] = RNIL;
- signal->theData[1] = tabPtr.p->totalfragments;
- signal->theData[2] = tabPtr.i;
- signal->theData[3] = senderData;
- signal->theData[4] = tabPtr.p->noOfBackups;
- sendSignal(senderRef, GSN_DI_FCOUNTCONF, signal, 5, JBB);
+ conf->m_connectionData = RNIL;
+ conf->m_tableRef = tabPtr.i;
+ conf->m_senderData = senderData;
+ conf->m_fragmentCount = tabPtr.p->totalfragments;
+ conf->m_noOfBackups = tabPtr.p->noOfBackups;
+ sendSignal(senderRef, GSN_DI_FCOUNTCONF, signal,
+ DihFragCountConf::SignalLength, JBB);
}//Dbdih::execDI_FCOUNTREQ()
void Dbdih::execDIGETPRIMREQ(Signal* signal)
@@ -8147,6 +8521,15 @@
if (reason == CopyGCIReq::GLOBAL_CHECKPOINT) {
jam();
cgcpParticipantState = GCP_PARTICIPANT_READY;
+
+ SubGcpCompleteRep * const rep = (SubGcpCompleteRep*)signal->getDataPtr();
+ rep->gci = coldgcp;
+ sendSignal(SUMA_REF, GSN_SUB_GCP_COMPLETE_REP, signal,
+ SubGcpCompleteRep::SignalLength, JBB);
+
+ EXECUTE_DIRECT(LGMAN, GSN_SUB_GCP_COMPLETE_REP, signal,
+ SubGcpCompleteRep::SignalLength);
+ jamEntry();
}
jam();
@@ -8235,9 +8618,9 @@
continue;
}
- if (tabPtr.p->storedTable == 0) {
+ if (tabPtr.p->tabStorage != TabRecord::ST_NORMAL) {
/**
- * Temporary table
+ * Table is not logged
*/
jam();
tabPtr.p->tabLcpStatus = TabRecord::TLS_COMPLETED;
@@ -8550,7 +8933,7 @@
ConstPtr<ReplicaRecord> constReplicaPtr;
constReplicaPtr.i = replicaPtr.i;
constReplicaPtr.p = replicaPtr.p;
- if (tabPtr.p->storedTable == 0 ||
+ if (tabPtr.p->tabStorage != TabRecord::ST_NORMAL ||
setup_create_replica(fragPtr,
&createReplica, constReplicaPtr))
{
@@ -8743,12 +9126,11 @@
rf.rwfTabPtr.p->hashpointer = readPageWord(&rf);
rf.rwfTabPtr.p->kvalue = readPageWord(&rf);
rf.rwfTabPtr.p->mask = readPageWord(&rf);
- ndbrequire(readPageWord(&rf) == TabRecord::HASH);
- rf.rwfTabPtr.p->method = TabRecord::HASH;
- /* ---------------------------------- */
- /* Type of table, 2 = temporary table */
- /* ---------------------------------- */
- rf.rwfTabPtr.p->storedTable = readPageWord(&rf);
+ rf.rwfTabPtr.p->method = (TabRecord::Method)readPageWord(&rf);
+ /* ------------- */
+ /* Type of table */
+ /* ------------- */
+ rf.rwfTabPtr.p->tabStorage = (TabRecord::Storage)(readPageWord(&rf));
Uint32 noOfFrags = rf.rwfTabPtr.p->totalfragments;
ndbrequire(noOfFrags > 0);
@@ -8838,8 +9220,8 @@
writePageWord(&wf, tabPtr.p->hashpointer);
writePageWord(&wf, tabPtr.p->kvalue);
writePageWord(&wf, tabPtr.p->mask);
- writePageWord(&wf, TabRecord::HASH);
- writePageWord(&wf, tabPtr.p->storedTable);
+ writePageWord(&wf, tabPtr.p->method);
+ writePageWord(&wf, tabPtr.p->tabStorage);
signal->theData[0] = DihContinueB::ZPACK_FRAG_INTO_PAGES;
signal->theData[1] = tabPtr.i;
@@ -8939,6 +9321,80 @@
/*****************************************************************************/
/* ********** START FRAGMENT MODULE *************/
/*****************************************************************************/
+void
+Dbdih::dump_replica_info()
+{
+ TabRecordPtr tabPtr;
+ FragmentstorePtr fragPtr;
+
+ for(tabPtr.i = 0; tabPtr.i < ctabFileSize; tabPtr.i++)
+ {
+ ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
+ if (tabPtr.p->tabStatus != TabRecord::TS_ACTIVE)
+ continue;
+
+ for(Uint32 fid = 0; fid<tabPtr.p->totalfragments; fid++)
+ {
+ getFragstore(tabPtr.p, fid, fragPtr);
+ ndbout_c("tab: %d frag: %d gci: %d\n -- storedReplicas:",
+ tabPtr.i, fid, SYSFILE->newestRestorableGCI);
+
+ Uint32 i;
+ ReplicaRecordPtr replicaPtr;
+ replicaPtr.i = fragPtr.p->storedReplicas;
+ for(; replicaPtr.i != RNIL; replicaPtr.i = replicaPtr.p->nextReplica)
+ {
+ ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
+ ndbout_c(" node: %d initialGci: %d nextLcp: %d noCrashedReplicas: %d",
+ replicaPtr.p->procNode,
+ replicaPtr.p->initialGci,
+ replicaPtr.p->nextLcp,
+ replicaPtr.p->noCrashedReplicas);
+ for(i = 0; i<MAX_LCP_STORED; i++)
+ {
+ ndbout_c(" i: %d %s : lcpId: %d maxGci Completed: %d Started: %d",
+ i,
+ (replicaPtr.p->lcpStatus[i] == ZVALID ?"VALID":"INVALID"),
+ replicaPtr.p->lcpId[i],
+ replicaPtr.p->maxGciCompleted[i],
+ replicaPtr.p->maxGciStarted[i]);
+ }
+
+ for (i = 0; i < 8; i++)
+ {
+ ndbout_c(" crashed replica: %d replicaLastGci: %d createGci: %d",
+ i,
+ replicaPtr.p->replicaLastGci[i],
+ replicaPtr.p->createGci[i]);
+ }
+ }
+ ndbout_c(" -- oldStoredReplicas");
+ replicaPtr.i = fragPtr.p->oldStoredReplicas;
+ for(; replicaPtr.i != RNIL; replicaPtr.i = replicaPtr.p->nextReplica)
+ {
+ ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
+ for(i = 0; i<MAX_LCP_STORED; i++)
+ {
+ ndbout_c(" i: %d %s : lcpId: %d maxGci Completed: %d Started: %d",
+ i,
+ (replicaPtr.p->lcpStatus[i] == ZVALID ?"VALID":"INVALID"),
+ replicaPtr.p->lcpId[i],
+ replicaPtr.p->maxGciCompleted[i],
+ replicaPtr.p->maxGciStarted[i]);
+ }
+
+ for (i = 0; i < 8; i++)
+ {
+ ndbout_c(" crashed replica: %d replicaLastGci: %d createGci: %d",
+ i,
+ replicaPtr.p->replicaLastGci[i],
+ replicaPtr.p->createGci[i]);
+ }
+ }
+ }
+ }
+}
+
void Dbdih::startFragment(Signal* signal, Uint32 tableId, Uint32 fragId)
{
Uint32 TloopCount = 0;
@@ -8970,7 +9426,7 @@
continue;
}
- if(tabPtr.p->storedTable == 0){
+ if(tabPtr.p->tabStorage != TabRecord::ST_NORMAL){
jam();
TloopCount++;
tableId++;
@@ -9000,6 +9456,7 @@
/* SEARCH FOR STORED REPLICAS THAT CAN BE USED TO RESTART THE SYSTEM. */
/* ----------------------------------------------------------------------- */
searchStoredReplicas(fragPtr);
+
if (cnoOfCreateReplicas == 0) {
/* --------------------------------------------------------------------- */
/* THERE WERE NO STORED REPLICAS AVAILABLE THAT CAN SERVE AS REPLICA TO*/
@@ -9012,6 +9469,10 @@
char buf[64];
BaseString::snprintf(buf, sizeof(buf), "table: %d fragment: %d gci: %d",
tableId, fragId, SYSFILE->newestRestorableGCI);
+
+ ndbout_c(buf);
+ dump_replica_info();
+
progError(__LINE__, NDBD_EXIT_NO_RESTORABLE_REPLICA, buf);
ndbrequire(false);
return;
@@ -9088,8 +9549,8 @@
// otherwise we have a problem.
/* --------------------------------------------------------------------- */
jam();
- ndbrequire(senderNodeId == c_nodeStartMaster.startNode);
- nodeRestartStartRecConfLab(signal);
+ ndbout_c("startNextCopyFragment");
+ startNextCopyFragment(signal, findTakeOver(senderNodeId));
return;
} else {
/* --------------------------------------------------------------------- */
@@ -9591,7 +10052,7 @@
}//if
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
if (tabPtr.p->tabStatus != TabRecord::TS_ACTIVE ||
- tabPtr.p->storedTable == 0) {
+ tabPtr.p->tabStorage != TabRecord::ST_NORMAL) {
if (TloopCount > 100) {
jam();
signal->theData[0] = DihContinueB::ZCALCULATE_KEEP_GCI;
@@ -9951,12 +10412,42 @@
Uint32 fragId = lcpReport->fragId;
jamEntry();
+
+ if (ERROR_INSERTED(7178) && nodeId != getOwnNodeId())
+ {
+ jam();
+ Uint32 owng =Sysfile::getNodeGroup(getOwnNodeId(), SYSFILE->nodeGroups);
+ Uint32 nodeg = Sysfile::getNodeGroup(nodeId, SYSFILE->nodeGroups);
+ if (owng == nodeg)
+ {
+ jam();
+ ndbout_c("throwing away LCP_FRAG_REP from (and killing) %d", nodeId);
+ SET_ERROR_INSERT_VALUE(7179);
+ signal->theData[0] = 9999;
+ sendSignal(numberToRef(CMVMI, nodeId),
+ GSN_NDB_TAMPER, signal, 1, JBA);
+ return;
+ }
+ }
+ if (ERROR_INSERTED(7179) && nodeId != getOwnNodeId())
+ {
+ jam();
+ Uint32 owng =Sysfile::getNodeGroup(getOwnNodeId(), SYSFILE->nodeGroups);
+ Uint32 nodeg = Sysfile::getNodeGroup(nodeId, SYSFILE->nodeGroups);
+ if (owng == nodeg)
+ {
+ jam();
+ ndbout_c("throwing away LCP_FRAG_REP from %d", nodeId);
+ return;
+ }
+ }
+
CRASH_INSERTION2(7025, isMaster());
CRASH_INSERTION2(7016, !isMaster());
-
+
bool fromTimeQueue = (signal->senderBlockRef() == reference());
-
+
TabRecordPtr tabPtr;
tabPtr.i = tableId;
ptrCheckGuard(tabPtr, ctabFileSize, tabRecord);
@@ -10119,9 +10610,11 @@
}
void Dbdih::findReplica(ReplicaRecordPtr& replicaPtr,
- Fragmentstore* fragPtrP, Uint32 nodeId)
+ Fragmentstore* fragPtrP,
+ Uint32 nodeId,
+ bool old)
{
- replicaPtr.i = fragPtrP->storedReplicas;
+ replicaPtr.i = old ? fragPtrP->oldStoredReplicas : fragPtrP->storedReplicas;
while(replicaPtr.i != RNIL){
ptrCheckGuard(replicaPtr, creplicaFileSize, replicaRecord);
if (replicaPtr.p->procNode == nodeId) {
@@ -10155,6 +10648,35 @@
ndbrequire(false);
}//Dbdih::findReplica()
+
+int
+Dbdih::handle_invalid_lcp_no(const LcpFragRep* rep,
+ ReplicaRecordPtr replicaPtr)
+{
+ ndbrequire(!isMaster());
+ Uint32 lcpNo = rep->lcpNo;
+ Uint32 lcpId = rep->lcpId;
+
+ warningEvent("Detected previous node failure of %d during lcp",
+ rep->nodeId);
+ replicaPtr.p->nextLcp = lcpNo;
+ replicaPtr.p->lcpId[lcpNo] = 0;
+ replicaPtr.p->lcpStatus[lcpNo] = ZINVALID;
+
+ for (Uint32 i = lcpNo; i != lcpNo; i = nextLcpNo(i))
+ {
+ jam();
+ if (replicaPtr.p->lcpStatus[i] == ZVALID &&
+ replicaPtr.p->lcpId[i] >= lcpId)
+ {
+ ndbout_c("i: %d lcpId: %d", i, replicaPtr.p->lcpId[i]);
+ ndbrequire(false);
+ }
+ }
+
+ return 0;
+}
+
/**
* Return true if table is all fragment replicas have been checkpointed
* to disk (in all LQHs)
@@ -10183,9 +10705,12 @@
ndbrequire(replicaPtr.p->lcpOngoingFlag == true);
if(lcpNo != replicaPtr.p->nextLcp){
- g_eventLogger.error("lcpNo = %d replicaPtr.p->nextLcp = %d",
- lcpNo, replicaPtr.p->nextLcp);
- ndbrequire(false);
+ if (handle_invalid_lcp_no(lcpReport, replicaPtr))
+ {
+ g_eventLogger.error("lcpNo = %d replicaPtr.p->nextLcp = %d",
+ lcpNo, replicaPtr.p->nextLcp);
+ ndbrequire(false);
+ }
}
ndbrequire(lcpNo == replicaPtr.p->nextLcp);
ndbrequire(lcpNo < MAX_LCP_STORED);
@@ -10529,6 +11054,14 @@
/* ------------------------------------------------------------------------- */
void Dbdih::tableUpdateLab(Signal* signal, TabRecordPtr tabPtr) {
FileRecordPtr filePtr;
+ if(tabPtr.p->tabStorage == TabRecord::ST_TEMPORARY) {
+ // For temporary tables we do not write to disk. Mark both copies 0 and 1
+ // as done, and go straight to the after-close code.
+ filePtr.i = tabPtr.p->tabFile[1];
+ ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
+ tableCloseLab(signal, filePtr);
+ return;
+ }
filePtr.i = tabPtr.p->tabFile[0];
ptrCheckGuard(filePtr, cfileFileSize, fileRecord);
createFileRw(signal, filePtr);
@@ -11147,6 +11680,7 @@
{
ConstPtr<ReplicaRecord> fblFoundReplicaPtr;
ConstPtr<ReplicaRecord> fblReplicaPtr;
+ LINT_INIT(fblFoundReplicaPtr.p);
/* --------------------------------------------------------------------- */
/* WE START WITH ZERO AS FOUND TO ENSURE THAT FIRST HIT WILL BE */
@@ -11389,6 +11923,7 @@
cnoHotSpare = 0;
cnoOfActiveTables = 0;
cnoOfNodeGroups = 0;
+ c_nextNodeGroup = 0;
cnoReplicas = 0;
coldgcp = 0;
coldGcpId = 0;
@@ -11408,6 +11943,7 @@
c_newest_restorable_gci = 0;
cverifyQueueCounter = 0;
cwaitLcpSr = false;
+ c_nextLogPart = 0;
nodeResetStart();
c_nodeStartMaster.wait = ZFALSE;
@@ -11415,7 +11951,7 @@
memset(&sysfileData[0], 0, sizeof(sysfileData));
const ndb_mgm_configuration_iterator * p =
- theConfiguration.getOwnConfigIterator();
+ m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
c_lcpState.clcpDelay = 20;
@@ -11494,6 +12030,8 @@
SYSFILE->takeOver[i] = 0;
}//for
Sysfile::setInitialStartOngoing(SYSFILE->systemRestartBits);
+ srand(time(0));
+ globalData.m_restart_seq = SYSFILE->m_restart_seq = 0;
}//Dbdih::initRestartInfo()
/*--------------------------------------------------------------------*/
@@ -11560,7 +12098,7 @@
tabPtr.p->kvalue = 0;
tabPtr.p->hashpointer = (Uint32)-1;
tabPtr.p->mask = 0;
- tabPtr.p->storedTable = 1;
+ tabPtr.p->tabStorage = TabRecord::ST_NORMAL;
tabPtr.p->tabErrorCode = 0;
tabPtr.p->schemaVersion = (Uint32)-1;
tabPtr.p->tabRemoveNode = RNIL;
@@ -11983,7 +12521,7 @@
(buf, sizeof(buf),
"Illegal initial start, no alive node in nodegroup %u", i);
progError(__LINE__,
- NDBD_EXIT_SR_RESTARTCONFLICT,
+ NDBD_EXIT_INSUFFICENT_NODES,
buf);
}
@@ -12123,14 +12661,23 @@
/* THAT THE NEW REPLICA IS NOT STARTED YET AND REPLICA_LAST_GCI IS*/
/* SET TO -1 TO INDICATE THAT IT IS NOT DEAD YET. */
/*----------------------------------------------------------------------*/
+ Uint32 lastGCI = SYSFILE->lastCompletedGCI[nodeId];
arrGuardErr(ncrReplicaPtr.p->noCrashedReplicas + 1, 8,
NDBD_EXIT_MAX_CRASHED_REPLICAS);
ncrReplicaPtr.p->replicaLastGci[ncrReplicaPtr.p->noCrashedReplicas] =
- SYSFILE->lastCompletedGCI[nodeId];
+ lastGCI;
ncrReplicaPtr.p->noCrashedReplicas = ncrReplicaPtr.p->noCrashedReplicas + 1;
ncrReplicaPtr.p->createGci[ncrReplicaPtr.p->noCrashedReplicas] = 0;
ncrReplicaPtr.p->replicaLastGci[ncrReplicaPtr.p->noCrashedReplicas] =
(Uint32)-1;
+
+ if (ncrReplicaPtr.p->noCrashedReplicas == 7 && lastGCI)
+ {
+ jam();
+ SYSFILE->lastCompletedGCI[nodeId] = 0;
+ warningEvent("Making filesystem for node %d unusable (need --initial)",
+ nodeId);
+ }
}//Dbdih::newCrashedReplica()
/*************************************************************************/
@@ -12244,6 +12791,8 @@
jam();
fragPtr.p->distributionKey = TdistKey;
}//if
+
+ fragPtr.p->m_log_part_id = readPageWord(rf);
}//Dbdih::readFragment()
Uint32 Dbdih::readPageWord(RWFragment* rf)
@@ -13340,6 +13889,7 @@
writePageWord(wf, fragPtr.p->noStoredReplicas);
writePageWord(wf, fragPtr.p->noOldStoredReplicas);
writePageWord(wf, fragPtr.p->distributionKey);
+ writePageWord(wf, fragPtr.p->m_log_part_id);
}//Dbdih::writeFragment()
void Dbdih::writePageWord(RWFragment* wf, Uint32 dataWord)
@@ -13406,7 +13956,7 @@
signal->theData[0] = filePtr.p->fileRef;
signal->theData[1] = reference();
signal->theData[2] = filePtr.i;
- signal->theData[3] = ZLIST_OF_PAIRS;
+ signal->theData[3] = ZLIST_OF_PAIRS_SYNCH;
signal->theData[4] = ZVAR_NO_WORD;
signal->theData[5] = tab->noPages;
for (Uint32 i = 0; i < tab->noPages; i++) {
@@ -13769,7 +14319,7 @@
if (signal->getLength() == 1)
{
const ndb_mgm_configuration_iterator * p =
- theConfiguration.getOwnConfigIterator();
+ m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
ndb_mgm_get_int_parameter(p, CFG_DB_GCP_INTERVAL, &cgcpDelay);
}
@@ -14870,13 +15420,14 @@
{
Uint32 masterVersion = getNodeInfo(cmasterNodeId).m_version;
- unsigned int get_major = getMajor(masterVersion);
- unsigned int get_minor = getMinor(masterVersion);
- unsigned int get_build = getBuild(masterVersion);
-
- ndbrequire(get_major == 4 || get_major == 5);
+ const unsigned int get_major = getMajor(masterVersion);
+ const unsigned int get_minor = getMinor(masterVersion);
+ const unsigned int get_build = getBuild(masterVersion);
+ ndbrequire(get_major >= 4);
if (masterVersion < NDBD_DICT_LOCK_VERSION_5 ||
+ masterVersion < NDBD_DICT_LOCK_VERSION_5_1 &&
+ get_major == 5 && get_minor == 1 ||
ERROR_INSERTED(7176)) {
jam();
@@ -14947,10 +15498,13 @@
{
Uint32 masterVersion = getNodeInfo(cmasterNodeId).m_version;
- unsigned int get_major = getMajor(masterVersion);
- ndbrequire(get_major == 4 || get_major == 5);
+ const unsigned int get_major = getMajor(masterVersion);
+ const unsigned int get_minor = getMinor(masterVersion);
+ ndbrequire(get_major >= 4);
if (masterVersion < NDBD_DICT_LOCK_VERSION_5 ||
+ masterVersion < NDBD_DICT_LOCK_VERSION_5_1 &&
+ get_major == 5 && get_minor == 1 ||
ERROR_INSERTED(7176)) {
return;
}
--- 1.26.20.1/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2007-03-21 15:42:10 +01:00
+++ 1.52/storage/ndb/src/kernel/blocks/dbtc/Dbtc.hpp 2007-03-22 13:20:36 +01:00
@@ -388,6 +388,13 @@
Uint32 fireingOperation;
/**
+ * The fragment id of the firing operation. This will be appended
+ * to the Primary Key such that the record can be found even in the
+ * case of user defined partitioning.
+ */
+ Uint32 fragId;
+
+ /**
* Used for scrapping in case of node failure
*/
Uint32 nodeId;
@@ -525,7 +532,7 @@
/**
* The list of defined indexes
*/
- ArrayList<TcIndexData> c_theIndexes;
+ DLList<TcIndexData> c_theIndexes;
UintR c_maxNumberOfIndexes;
struct TcIndexOperation {
@@ -731,7 +738,7 @@
UintR accumulatingIndexOp;
UintR executingIndexOp;
UintR tcIndxSendArray[6];
- ArrayList<TcIndexOperation> theSeizedIndexOperations;
+ DLList<TcIndexOperation> theSeizedIndexOperations;
};
typedef Ptr<ApiConnectRecord> ApiConnectRecordPtr;
@@ -866,7 +873,7 @@
Uint8 distributionKeyIndicator;
Uint8 m_special_hash; // collation or distribution key
- Uint8 unused2;
+ Uint8 m_no_disk_flag;
Uint8 lenAiInTckeyreq; /* LENGTH OF ATTRIBUTE INFORMATION IN TCKEYREQ */
Uint8 fragmentDistributionKey; /* DIH generation no */
@@ -877,11 +884,7 @@
*/
Uint8 opExec;
- /**
- * LOCK TYPE OF OPERATION IF READ OPERATION
- * 0 = READ LOCK, 1 = WRITE LOCK
- */
- Uint8 opLock;
+ Uint8 unused;
/**
* IS THE OPERATION A SIMPLE TRANSACTION
@@ -941,8 +944,7 @@
NF_CHECK_SCAN = 0x2,
NF_CHECK_TRANSACTION = 0x4,
NF_CHECK_DROP_TAB = 0x8,
- NF_NODE_FAIL_BITS = 0xF, // All bits...
- NF_STARTED = 0x10
+ NF_NODE_FAIL_BITS = 0xF // All bits...
};
Uint32 m_nf_bits;
NdbNodeBitmask m_lqh_trans_conf;
@@ -967,7 +969,8 @@
Uint8 noOfKeyAttr;
Uint8 hasCharAttr;
Uint8 noOfDistrKeys;
-
+ Uint8 hasVarKeys;
+
bool checkTable(Uint32 schemaVersion) const {
return enabled && !dropping &&
(table_version_major(schemaVersion) == table_version_major(currentSchemaVersion));
@@ -1262,7 +1265,7 @@
typedef Ptr<TcFailRecord> TcFailRecordPtr;
public:
- Dbtc(const class Configuration &);
+ Dbtc(Block_context&);
virtual ~Dbtc();
private:
@@ -1282,7 +1285,7 @@
void execLQHKEYREF(Signal* signal);
void execTRANSID_AI_R(Signal* signal);
void execKEYINFO20_R(Signal* signal);
-
+ void execROUTE_ORD(Signal* signal);
// Received signals
void execDUMP_STATE_ORD(Signal* signal);
void execSEND_PACKED(Signal* signal);
@@ -1320,7 +1323,6 @@
void execCOMMITCONF(Signal* signal);
void execABORTCONF(Signal* signal);
void execNODE_FAILREP(Signal* signal);
- void execNODE_START_REP(Signal* signal);
void execINCL_NODEREQ(Signal* signal);
void execTIME_SIGNAL(Signal* signal);
void execAPI_FAILREQ(Signal* signal);
--- 1.73.40.1/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2007-03-21 15:42:11 +01:00
+++ 1.140/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2007-03-22 13:20:36 +01:00
@@ -37,6 +37,7 @@
#include <signaldata/TcContinueB.hpp>
#include <signaldata/TcKeyFailConf.hpp>
#include <signaldata/AbortAll.hpp>
+#include <signaldata/DihFragCount.hpp>
#include <signaldata/ScanFrag.hpp>
#include <signaldata/ScanTab.hpp>
#include <signaldata/PrepDropTab.hpp>
@@ -70,6 +71,8 @@
#include <NdbOut.hpp>
#include <DebuggerNames.hpp>
+#include <signaldata/RouteOrd.hpp>
+
// Use DEBUG to print messages that should be
// seen only when we debug the product
#ifdef VM_TRACE
@@ -343,7 +346,7 @@
tabptr.p->noOfKeyAttr = desc->noOfKeyAttr;
tabptr.p->hasCharAttr = desc->hasCharAttr;
tabptr.p->noOfDistrKeys = desc->noOfDistrKeys;
-
+ tabptr.p->hasVarKeys = desc->noOfVarKeys > 0;
signal->theData[0] = tabptr.i;
signal->theData[1] = retPtr;
sendSignal(retRef, GSN_TC_SCHVERCONF, signal, 2, JBB);
@@ -609,7 +612,7 @@
jamEntry();
const ndb_mgm_configuration_iterator * p =
- theConfiguration.getOwnConfigIterator();
+ m_ctx.m_config.getOwnConfigIterator();
ndbrequire(p != 0);
initData();
@@ -1293,6 +1296,7 @@
apiConnectptr.p->firstTcConnect == RNIL))
{
jam(); /* JUST REPLY OK */
+ apiConnectptr.p->m_transaction_nodes.clear();
releaseApiCon(signal, apiConnectptr.i);
signal->theData[0] = tuserpointer;
sendSignal(tapiBlockref,
@@ -2295,14 +2299,15 @@
{
Uint64 Tmp[MAX_KEY_SIZE_IN_WORDS * MAX_XFRM_MULTIPLY];
const TableRecord* tabPtrP = &tableRecord[tabPtrI];
+ const bool hasVarKeys = tabPtrP->hasVarKeys;
const bool hasCharAttr = tabPtrP->hasCharAttr;
- const bool hasDistKeys = tabPtrP->noOfDistrKeys > 0;
+ const bool compute_distkey = distr && (tabPtrP->noOfDistrKeys > 0);
Uint32 *dst = (Uint32*)Tmp;
Uint32 dstPos = 0;
Uint32 keyPartLen[MAX_ATTRIBUTES_IN_INDEX];
Uint32 * keyPartLenPtr;
- if(hasCharAttr)
+ if(hasCharAttr || (compute_distkey && hasVarKeys))
{
keyPartLenPtr = keyPartLen;
dstPos = xfrm_key(tabPtrI, src, dst, sizeof(Tmp) >> 2, keyPartLenPtr);
@@ -2320,7 +2325,7 @@
md5_hash(dstHash, (Uint64*)dst, dstPos);
- if(distr && hasDistKeys)
+ if(compute_distkey)
{
jam();
@@ -2517,7 +2522,7 @@
ApiConnectRecord * const regApiPtr = &localApiConnectRecord[TapiIndex];
apiConnectptr.p = regApiPtr;
- Uint32 TstartFlag = tcKeyReq->getStartFlag(Treqinfo);
+ Uint32 TstartFlag = TcKeyReq::getStartFlag(Treqinfo);
Uint32 TexecFlag = TcKeyReq::getExecuteFlag(Treqinfo);
Uint8 isIndexOp = regApiPtr->isIndexOp;
@@ -2687,14 +2692,14 @@
/* */
/* ---------------------------------------------------------------------- */
- UintR TapiVersionNo = tcKeyReq->getAPIVersion(tcKeyReq->attrLen);
+ UintR TapiVersionNo = TcKeyReq::getAPIVersion(tcKeyReq->attrLen);
UintR Tlqhkeyreqrec = regApiPtr->lqhkeyreqrec;
regApiPtr->lqhkeyreqrec = Tlqhkeyreqrec + 1;
regCachePtr->apiVersionNo = TapiVersionNo;
UintR TapiConnectptrIndex = apiConnectptr.i;
UintR TsenderData = tcKeyReq->senderData;
- UintR TattrLen = tcKeyReq->getAttrinfoLen(tcKeyReq->attrLen);
+ UintR TattrLen = TcKeyReq::getAttrinfoLen(tcKeyReq->attrLen);
UintR TattrinfoCount = c_counters.cattrinfoCount;
regTcPtr->apiConnect = TapiConnectptrIndex;
@@ -2720,21 +2725,23 @@
UintR TtabptrIndex = localTabptr.i;
UintR TtableSchemaVersion = tcKeyReq->tableSchemaVersion;
- Uint8 TOperationType = tcKeyReq->getOperationType(Treqinfo);
+ Uint8 TOperationType = TcKeyReq::getOperationType(Treqinfo);
regCachePtr->tableref = TtabptrIndex;
regCachePtr->schemaVersion = TtableSchemaVersion;
regTcPtr->operation = TOperationType;
- Uint8 TSimpleFlag = tcKeyReq->getSimpleFlag(Treqinfo);
- Uint8 TDirtyFlag = tcKeyReq->getDirtyFlag(Treqinfo);
- Uint8 TInterpretedFlag = tcKeyReq->getInterpretedFlag(Treqinfo);
- Uint8 TDistrKeyFlag = tcKeyReq->getDistributionKeyFlag(Treqinfo);
+ Uint8 TSimpleFlag = TcKeyReq::getSimpleFlag(Treqinfo);
+ Uint8 TDirtyFlag = TcKeyReq::getDirtyFlag(Treqinfo);
+ Uint8 TInterpretedFlag = TcKeyReq::getInterpretedFlag(Treqinfo);
+ Uint8 TDistrKeyFlag = TcKeyReq::getDistributionKeyFlag(Treqinfo);
+ Uint8 TNoDiskFlag = TcKeyReq::getNoDiskFlag(Treqinfo);
Uint8 TexecuteFlag = TexecFlag;
regCachePtr->opSimple = TSimpleFlag;
regCachePtr->opExec = TInterpretedFlag;
regTcPtr->dirtyOp = TDirtyFlag;
regCachePtr->distributionKeyIndicator = TDistrKeyFlag;
+ regCachePtr->m_no_disk_flag = TNoDiskFlag;
//-------------------------------------------------------------
// The next step is to read the upto three conditional words.
@@ -2742,10 +2749,10 @@
Uint32 TkeyIndex;
Uint32* TOptionalDataPtr = (Uint32*)&tcKeyReq->scanInfo;
{
- Uint32 TDistrGHIndex = tcKeyReq->getScanIndFlag(Treqinfo);
+ Uint32 TDistrGHIndex = TcKeyReq::getScanIndFlag(Treqinfo);
Uint32 TDistrKeyIndex = TDistrGHIndex;
- Uint32 TscanInfo = tcKeyReq->getTakeOverScanInfo(TOptionalDataPtr[0]);
+ Uint32 TscanInfo = TcKeyReq::getTakeOverScanInfo(TOptionalDataPtr[0]);
regCachePtr->scanTakeOverInd = TDistrGHIndex;
regCachePtr->scanInfo = TscanInfo;
@@ -2767,7 +2774,7 @@
regCachePtr->keydata[2] = Tdata3;
regCachePtr->keydata[3] = Tdata4;
- TkeyLength = tcKeyReq->getKeyLength(Treqinfo);
+ TkeyLength = TcKeyReq::getKeyLength(Treqinfo);
Uint32 TAIDataIndex;
if (TkeyLength > 8) {
TAIDataIndex = TkeyIndex + 8;
@@ -2780,7 +2787,7 @@
}//if
Uint32* TAIDataPtr = &TOptionalDataPtr[TAIDataIndex];
- titcLenAiInTckeyreq = tcKeyReq->getAIInTcKeyReq(Treqinfo);
+ titcLenAiInTckeyreq = TcKeyReq::getAIInTcKeyReq(Treqinfo);
regCachePtr->keylen = TkeyLength;
regCachePtr->lenAiInTckeyreq = titcLenAiInTckeyreq;
regCachePtr->currReclenAi = titcLenAiInTckeyreq;
@@ -2798,17 +2805,9 @@
regCachePtr->attrinfo15[2] = Tdata4;
regCachePtr->attrinfo15[3] = Tdata5;
- if (TOperationType == ZREAD) {
- Uint32 TreadCount = c_counters.creadCount;
- jam();
- regCachePtr->opLock = 0;
- c_counters.creadCount = TreadCount + 1;
- } else if(TOperationType == ZREAD_EX){
+ if (TOperationType == ZREAD || TOperationType == ZREAD_EX) {
Uint32 TreadCount = c_counters.creadCount;
jam();
- TOperationType = ZREAD;
- regTcPtr->operation = ZREAD;
- regCachePtr->opLock = ZUPDATE;
c_counters.creadCount = TreadCount + 1;
} else {
if(regApiPtr->commitAckMarker == RNIL){
@@ -2825,6 +2824,12 @@
tmp.p->apiNodeId = refToNode(regApiPtr->ndbapiBlockref);
tmp.p->apiConnectPtr = TapiIndex;
tmp.p->noOfLqhs = 0;
+#if defined VM_TRACE || defined ERROR_INSERT
+ {
+ CommitAckMarkerPtr check;
+ ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+ }
+#endif
m_commitAckMarkerHash.add(tmp);
}
}
@@ -2842,24 +2847,10 @@
c_counters.cwriteCount = TwriteCount + 1;
switch (TOperationType) {
case ZUPDATE:
- jam();
- if (TattrLen == 0) {
- //TCKEY_abort(signal, 5);
- //return;
- }//if
- /*---------------------------------------------------------------------*/
- // The missing break is intentional since we also want to set the opLock
- // variable also for updates
- /*---------------------------------------------------------------------*/
case ZINSERT:
case ZDELETE:
- jam();
- regCachePtr->opLock = TOperationType;
- break;
case ZWRITE:
jam();
- // A write operation is originally an insert operation.
- regCachePtr->opLock = ZINSERT;
break;
default:
TCKEY_abort(signal, 9);
@@ -2867,14 +2858,14 @@
}//switch
}//if
- Uint32 TabortOption = tcKeyReq->getAbortOption(Treqinfo);
+ Uint32 TabortOption = TcKeyReq::getAbortOption(Treqinfo);
regTcPtr->m_execAbortOption = TabortOption;
/*-------------------------------------------------------------------------
* Check error handling per operation
* If CommitFlag is set state accordingly and check for early abort
*------------------------------------------------------------------------*/
- if (tcKeyReq->getCommitFlag(Treqinfo) == 1) {
+ if (TcKeyReq::getCommitFlag(Treqinfo) == 1) {
ndbrequire(TexecuteFlag);
regApiPtr->apiConnectstate = CS_REC_COMMITTING;
} else {
@@ -3034,7 +3025,7 @@
tnoOfStandby = (tnodeinfo >> 8) & 3;
regCachePtr->fragmentDistributionKey = (tnodeinfo >> 16) & 255;
- if (Toperation == ZREAD) {
+ if (Toperation == ZREAD || Toperation == ZREAD_EX) {
if (Tdirty == 1) {
jam();
/*-------------------------------------------------------------*/
@@ -3067,28 +3058,7 @@
}//if
}//for
}
-
- if (regTcPtr->tcNodedata[0] != getOwnNodeId())
- {
- jam();
- for (Uint32 i = 0; i < tnoOfBackup + 1; i++)
- {
- HostRecordPtr hostPtr;
- hostPtr.i = regTcPtr->tcNodedata[i];
- ptrCheckGuard(hostPtr, chostFilesize, hostRecord);
- if (hostPtr.p->m_nf_bits & HostRecord::NF_STARTED)
- {
- jam();
- if (i != 0)
- {
- jam();
- regTcPtr->tcNodedata[0] = hostPtr.i;
- }
- break;
- }
- }
- }//if
- }
+ }//if
jam();
regTcPtr->lastReplicaNo = 0;
regTcPtr->noOfNodes = 1;
@@ -3184,6 +3154,7 @@
TcConnectRecord * const regTcPtr = tcConnectptr.p;
ApiConnectRecord * const regApiPtr = apiConnectptr.p;
CacheRecord * const regCachePtr = cachePtr.p;
+ Uint32 version = getNodeInfo(refToNode(TBRef)).m_version;
UintR sig0, sig1, sig2, sig3, sig4, sig5, sig6;
#ifdef ERROR_INSERT
if (ERROR_INSERTED(8002)) {
@@ -3227,7 +3198,12 @@
bool simpleRead = (sig1 == ZREAD && sig0 == ZTRUE);
LqhKeyReq::setKeyLen(Tdata10, regCachePtr->keylen);
LqhKeyReq::setLastReplicaNo(Tdata10, regTcPtr->lastReplicaNo);
- LqhKeyReq::setLockType(Tdata10, regCachePtr->opLock);
+ if (unlikely(version < NDBD_ROWID_VERSION))
+ {
+ Uint32 op = regTcPtr->operation;
+ Uint32 lock = (Operation_t) op == ZREAD_EX ? ZUPDATE : (Operation_t) op == ZWRITE ?
ZINSERT : (Operation_t) op;
+ LqhKeyReq::setLockType(Tdata10, lock);
+ }
/* ---------------------------------------------------------------------- */
// Indicate Application Reference is present in bit 15
/* ---------------------------------------------------------------------- */
@@ -3236,6 +3212,8 @@
LqhKeyReq::setInterpretedFlag(Tdata10, regCachePtr->opExec);
LqhKeyReq::setSimpleFlag(Tdata10, sig0);
LqhKeyReq::setOperation(Tdata10, sig1);
+ LqhKeyReq::setNoDiskFlag(Tdata10, regCachePtr->m_no_disk_flag);
+
/* -----------------------------------------------------------------------
* Sequential Number of first LQH = 0, bit 22-23
* IF ATTRIBUTE INFORMATION IS SENT IN TCKEYREQ,
@@ -3953,7 +3931,7 @@
const UintR TopWords = (UintR)regApiPtr->tckeyrec;
localHostptr.i = refToNode(regApiPtr->ndbapiBlockref);
const Uint32 type = getNodeInfo(localHostptr.i).m_type;
- const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::REP);
+ const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::MGM);
const BlockNumber TblockNum = refToBlock(regApiPtr->ndbapiBlockref);
const Uint32 Tmarker = (regApiPtr->commitAckMarker == RNIL) ? 0 : 1;
ptrAss(localHostptr, hostRecord);
@@ -4635,7 +4613,8 @@
commitConf->transId1 = regApiPtr->transid[0];
commitConf->transId2 = regApiPtr->transid[1];
commitConf->gci = regApiPtr->globalcheckpointid;
- sendSignal(regApiPtr->ndbapiBlockref, GSN_TC_COMMITCONF, signal,
+
+ sendSignal(regApiPtr->ndbapiBlockref, GSN_TC_COMMITCONF, signal,
TcCommitConf::SignalLength, JBB);
} else if (regApiPtr->returnsignal == RS_NO_RETURN) {
jam();
@@ -4825,13 +4804,14 @@
key.transid2 = signal->theData[1];
CommitAckMarkerPtr removedMarker;
- m_commitAckMarkerHash.release(removedMarker, key);
+ m_commitAckMarkerHash.remove(removedMarker, key);
if (removedMarker.i == RNIL) {
jam();
warningHandlerLab(signal, __LINE__);
return;
}//if
sendRemoveMarkers(signal, removedMarker.p);
+ m_commitAckMarkerPool.release(removedMarker);
}
void
@@ -5176,6 +5156,19 @@
return;
}
+ /* Only ref in certain situations */
+ {
+ const Uint32 opType = regTcPtr->operation;
+ if ( (opType == ZDELETE && errCode != ZNOT_FOUND)
+ || (opType == ZINSERT && errCode != ZALREADYEXIST)
+ || (opType == ZUPDATE && errCode != ZNOT_FOUND)
+ || (opType == ZWRITE && errCode != 839 && errCode != 840))
+ {
+ TCKEY_abort(signal, 49);
+ return;
+ }
+ }
+
/* *************** */
/* TCKEYREF < */
/* *************** */
@@ -7025,19 +7018,6 @@
}//Dbtc::execNODE_FAILREP()
void
-Dbtc::execNODE_START_REP(Signal* signal)
-{
- Uint32 nodeId = signal->theData[0];
- hostptr.i = nodeId;
- ptrCheckGuard(hostptr, chostFilesize, hostRecord);
- if (hostptr.p->m_nf_bits == 0)
- {
- jam();
- hostptr.p->m_nf_bits |= HostRecord::NF_STARTED;
- }
-}
-
-void
Dbtc::checkNodeFailComplete(Signal* signal,
Uint32 failedNodeId,
Uint32 bit)
@@ -7128,7 +7108,7 @@
if (transPtr.p->m_transaction_nodes.get(failedNodeId))
{
jam();
-
+
// Force timeout regardless of state
c_appl_timeout_value = 1;
setApiConTimer(transPtr.i, TtcTimer - 2, __LINE__);
@@ -8135,6 +8115,13 @@
tmp.p->noOfLqhs = 1;
tmp.p->lqhNodeId[0] = tnodeid;
tmp.p->apiConnectPtr = apiConnectptr.i;
+
+#if defined VM_TRACE || defined ERROR_INSERT
+ {
+ CommitAckMarkerPtr check;
+ ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+ }
+#endif
m_commitAckMarkerHash.add(tmp);
}
}//Dbtc::initApiConnectFail()
@@ -8291,6 +8278,12 @@
tmp.p->noOfLqhs = 1;
tmp.p->lqhNodeId[0] = tnodeid;
tmp.p->apiConnectPtr = apiConnectptr.i;
+#if defined VM_TRACE || defined ERROR_INSERT
+ {
+ CommitAckMarkerPtr check;
+ ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
+ }
+#endif
m_commitAckMarkerHash.add(tmp);
} else {
jam();
@@ -8827,6 +8820,7 @@
ScanFragReq::setDescendingFlag(tmp, ScanTabReq::getDescendingFlag(ri));
ScanFragReq::setTupScanFlag(tmp, ScanTabReq::getTupScanFlag(ri));
ScanFragReq::setAttrLen(tmp, scanTabReq->attrLenKeyLen & 0xFFFF);
+ ScanFragReq::setNoDiskFlag(tmp, ScanTabReq::getNoDiskFlag(ri));
scanptr.p->scanRequestInfo = tmp;
scanptr.p->scanStoredProcId = scanTabReq->storedProcId;
@@ -8948,9 +8942,11 @@
* THE FIRST STEP TO RECEIVE IS SUCCESSFULLY COMPLETED.
* WE MUST FIRST GET THE NUMBER OF FRAGMENTS IN THE TABLE.
***************************************************/
- signal->theData[0] = tcConnectptr.p->dihConnectptr;
- signal->theData[1] = scanptr.p->scanTableref;
- sendSignal(cdihblockref, GSN_DI_FCOUNTREQ, signal, 2, JBB);
+ DihFragCountReq * const req = (DihFragCountReq*)signal->getDataPtrSend();
+ req->m_connectionData = tcConnectptr.p->dihConnectptr;
+ req->m_tableRef = scanptr.p->scanTableref;
+ sendSignal(cdihblockref, GSN_DI_FCOUNTREQ, signal,
+ DihFragCountReq::SignalLength, JBB);
}
else
{
@@ -8961,17 +8957,18 @@
UintR TerrorIndicator = signal->theData[0];
jamEntry();
if (TerrorIndicator != 0) {
- signal->theData[0] = tcConnectptr.i;
- //signal->theData[1] Contains error
+ DihFragCountRef * const ref = (DihFragCountRef*)signal->getDataPtr();
+ ref->m_connectionData = tcConnectptr.i;
+ ref->m_error = signal->theData[1];
execDI_FCOUNTREF(signal);
return;
}
UintR Tdata1 = signal->theData[1];
scanptr.p->scanNextFragId = Tdata1;
-
- signal->theData[0] = tcConnectptr.i;
- signal->theData[1] = 1; // Frag count
+ DihFragCountConf * const conf = (DihFragCountConf*)signal->getDataPtr();
+ conf->m_connectionData = tcConnectptr.i;
+ conf->m_fragmentCount = 1; // Frag count
execDI_FCOUNTCONF(signal);
}
return;
@@ -8989,8 +8986,9 @@
void Dbtc::execDI_FCOUNTCONF(Signal* signal)
{
jamEntry();
- tcConnectptr.i = signal->theData[0];
- Uint32 tfragCount = signal->theData[1];
+ DihFragCountConf * const conf = (DihFragCountConf*)signal->getDataPtr();
+ tcConnectptr.i = conf->m_connectionData;
+ Uint32 tfragCount = conf->m_fragmentCount;
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
apiConnectptr.i = tcConnectptr.p->apiConnect;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
@@ -9074,9 +9072,10 @@
void Dbtc::execDI_FCOUNTREF(Signal* signal)
{
jamEntry();
- tcConnectptr.i = signal->theData[0];
+ DihFragCountRef * const ref = (DihFragCountRef*)signal->getDataPtr();
+ tcConnectptr.i = ref->m_connectionData;
ptrCheckGuard(tcConnectptr, ctcConnectFilesize, tcConnectRecord);
- const Uint32 errCode = signal->theData[1];
+ const Uint32 errCode = ref->m_error;
apiConnectptr.i = tcConnectptr.p->apiConnect;
ptrCheckGuard(apiConnectptr, capiConnectFilesize, apiConnectRecord);
ScanRecordPtr scanptr;
@@ -10232,6 +10231,7 @@
tabptr.p->noOfKeyAttr = 0;
tabptr.p->hasCharAttr = 0;
tabptr.p->noOfDistrKeys = 0;
+ tabptr.p->hasVarKeys = 0;
}//for
}//Dbtc::initTable()
@@ -11266,7 +11266,6 @@
ApiConnectRecordPtr transPtr;
TcConnectRecord *localTcConnectRecord = tcConnectRecord;
TcConnectRecordPtr opPtr;
-
/**
* TODO
* Check transid,
@@ -11280,6 +11279,7 @@
c_firedTriggerHash.remove(trigPtr);
+ trigPtr.p->fragId= fireOrd->fragId;
bool ok = trigPtr.p->keyValues.getSize() == fireOrd->m_noPrimKeyWords;
ok &= trigPtr.p->afterValues.getSize() == fireOrd->m_noAfterValueWords;
ok &= trigPtr.p->beforeValues.getSize() == fireOrd->m_noBeforeValueWords;
@@ -11457,7 +11457,7 @@
// If operation is readTupleExclusive or updateTuple then read index
// table with exclusive lock
Uint32 indexLength = TcKeyReq::getKeyLength(tcIndxRequestInfo);
- Uint32 attrLength = tcIndxReq->attrLen;
+ Uint32 attrLength = TcKeyReq::getAttrinfoLen(tcIndxReq->attrLen);
indexOp->expectedKeyInfo = indexLength;
Uint32 includedIndexLength = MIN(indexLength, indexBufSize);
indexOp->expectedAttrInfo = attrLength;
@@ -11491,7 +11491,7 @@
const UintR TopWords = (UintR)regApiPtr->tcindxrec;
localHostptr.i = refToNode(regApiPtr->ndbapiBlockref);
const Uint32 type = getNodeInfo(localHostptr.i).m_type;
- const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::REP);
+ const bool is_api = (type >= NodeInfo::API && type <= NodeInfo::MGM);
const BlockNumber TblockNum = refToBlock(regApiPtr->ndbapiBlockref);
const Uint32 Tmarker = (regApiPtr->commitAckMarker == RNIL ? 0 : 1);
ptrAss(localHostptr, hostRecord);
@@ -12188,7 +12188,11 @@
Uint32 dataPos = 0;
TcKeyReq * const tcIndxReq = &indexOp->tcIndxReq;
TcKeyReq * const tcKeyReq = (TcKeyReq *)signal->getDataPtrSend();
- Uint32 * dataPtr = &tcKeyReq->scanInfo;
+ /*
+ Data points to distrGroupHashValue since scanInfo is used to send
+ fragment id of receiving fragment
+ */
+ Uint32 * dataPtr = &tcKeyReq->distrGroupHashValue;
Uint32 tcKeyLength = TcKeyReq::StaticLength;
Uint32 tcKeyRequestInfo = tcIndxReq->requestInfo;
TcIndexData* indexData;
@@ -12227,11 +12231,16 @@
regApiPtr->executingIndexOp = indexOp->indexOpId;;
regApiPtr->noIndexOp++; // Increase count
- // Filter out AttributeHeader:s since this should not be in key
+ /*
+ Filter out AttributeHeader:s since this should not be in key.
+ Also filter out fragment id from primary key and handle that
+ separately by setting it as Distribution Key and set indicator.
+ */
+
AttributeHeader* attrHeader = (AttributeHeader *) aiIter.data;
Uint32 headerSize = attrHeader->getHeaderSize();
- Uint32 keySize = attrHeader->getDataSize();
+ Uint32 keySize = attrHeader->getDataSize() - 1;
TcKeyReq::setKeyLength(tcKeyRequestInfo, keySize);
// Skip header
if (headerSize == 1) {
@@ -12241,6 +12250,9 @@
jam();
moreKeyData = indexOp->transIdAI.next(aiIter, headerSize - 1);
}//if
+ tcKeyReq->scanInfo = *aiIter.data; //Fragment Id
+ moreKeyData = indexOp->transIdAI.next(aiIter);
+ TcKeyReq::setDistributionKeyFlag(tcKeyRequestInfo, 1U);
while(// If we have not read complete key
(keySize != 0) &&
(dataPos < keyBufSize)) {
@@ -12506,7 +12518,7 @@
tmp2.release();
LocalDataBuffer<11> tmp3(pool, trigPtr.p->afterValues);
tmp3.release();
- regApiPtr->theFiredTriggers.release(trigPtr.i);
+ regApiPtr->theFiredTriggers.release(trigPtr);
}
trigPtr = nextTrigPtr;
}
@@ -12623,7 +12635,7 @@
AttributeBuffer::DataBufferIterator iter;
Uint32 attrId = 0;
Uint32 keyLength = 0;
- Uint32 totalPrimaryKeyLength = 0;
+ Uint32 totalPrimaryKeyLength = 1; // fragment length
Uint32 hops;
indexTabPtr.i = indexData->indexId;
@@ -12676,11 +12688,12 @@
hops = attrHeader->getHeaderSize() + attrHeader->getDataSize();
moreAttrData = keyValues.next(iter, hops);
}
- AttributeHeader pkAttrHeader(attrId, totalPrimaryKeyLength);
+ AttributeHeader pkAttrHeader(attrId, totalPrimaryKeyLength << 2);
+ Uint32 attributesLength = afterValues.getSize() +
+ pkAttrHeader.getHeaderSize() + pkAttrHeader.getDataSize();
TcKeyReq::setKeyLength(tcKeyRequestInfo, keyLength);
- tcKeyReq->attrLen = afterValues.getSize() +
- pkAttrHeader.getHeaderSize() + pkAttrHeader.getDataSize();
+ tcKeyReq->attrLen = attributesLength;
tcKeyReq->tableId = indexData->indexId;
TcKeyReq::setOperationType(tcKeyRequestInfo, ZINSERT);
TcKeyReq::setExecutingTrigger(tcKeyRequestInfo, true);
@@ -12730,8 +12743,11 @@
}
tcKeyLength += dataPos;
- Uint32 attributesLength = afterValues.getSize() +
- pkAttrHeader.getHeaderSize() + pkAttrHeader.getDataSize();
+ /*
+ Size of attrinfo is unique index attributes one by one, header for each
+ of them (all contained in the afterValues data structure), plus a header,
+ the primary key (compacted) and the fragment id before the primary key
+ */
if (attributesLength <= attrBufSize) {
jam();
// ATTRINFO fits in TCKEYREQ
@@ -12748,6 +12764,10 @@
// as one attribute
pkAttrHeader.insertHeader(dataPtr);
dataPtr += pkAttrHeader.getHeaderSize();
+ /*
+ Insert fragment id before primary key as part of reference to tuple
+ */
+ *dataPtr++ = firedTriggerData->fragId;
moreAttrData = keyValues.first(iter);
while(moreAttrData) {
jam();
@@ -12943,6 +12963,29 @@
pkAttrHeader.insertHeader(dataPtr);
dataPtr += pkAttrHeader.getHeaderSize();
attrInfoPos += pkAttrHeader.getHeaderSize();
+ /*
+ Add fragment id before primary key
+ TODO: This code really needs to be made into a long signal
+ to remove this messy code.
+ */
+ if (attrInfoPos == AttrInfo::DataLength)
+ {
+ jam();
+ // Flush ATTRINFO
+#if INTERNAL_TRIGGER_TCKEYREQ_JBA
+ sendSignal(reference(), GSN_ATTRINFO, signal,
+ AttrInfo::HeaderLength + AttrInfo::DataLength, JBA);
+#else
+ EXECUTE_DIRECT(DBTC, GSN_ATTRINFO, signal,
+ AttrInfo::HeaderLength + AttrInfo::DataLength);
+ jamEntry();
+#endif
+ dataPtr = (Uint32 *) &attrInfo->attrData;
+ attrInfoPos = 0;
+ }
+ attrInfoPos++;
+ *dataPtr++ = firedTriggerData->fragId;
+
moreAttrData = keyValues.first(iter);
while(moreAttrData) {
jam();
@@ -13243,3 +13286,55 @@
return 0;
}
+void
+Dbtc::execROUTE_ORD(Signal* signal)
+{
+ jamEntry();
+ if(!assembleFragments(signal)){
+ jam();
+ return;
+ }
+
+ RouteOrd* ord = (RouteOrd*)signal->getDataPtr();
+ Uint32 dstRef = ord->dstRef;
+ Uint32 srcRef = ord->srcRef;
+ Uint32 gsn = ord->gsn;
+
+ if (likely(getNodeInfo(refToNode(dstRef)).m_connected))
+ {
+ jam();
+ Uint32 secCount = signal->getNoOfSections();
+ SegmentedSectionPtr ptr[3];
+ ndbrequire(secCount >= 1 && secCount <= 3);
+
+ jamLine(secCount);
+ for (Uint32 i = 0; i<secCount; i++)
+ signal->getSection(ptr[i], i);
+
+ /**
+ * Put section 0 in signal->theData
+ */
+ ndbrequire(ptr[0].sz <= 25);
+ copy(signal->theData, ptr[0]);
+
+ signal->header.m_noOfSections = 0;
+
+ /**
+ * Shift rest of sections
+ */
+ for(Uint32 i = 1; i<secCount; i++)
+ {
+ signal->setSection(ptr[i], i - 1);
+ }
+
+ sendSignal(dstRef, gsn, signal, ptr[0].sz, JBB);
+
+ signal->header.m_noOfSections = 0;
+ signal->setSection(ptr[0], 0);
+ releaseSections(signal);
+ return ;
+ }
+
+ warningEvent("Unable to route GSN: %d from %x to %x",
+ gsn, srcRef, dstRef);
+}
--- 1.13.25.1/ndb/test/ndbapi/testNodeRestart.cpp 2007-03-22 11:25:26 +01:00
+++ 1.51/storage/ndb/test/ndbapi/testNodeRestart.cpp 2007-03-22 13:20:36 +01:00
@@ -697,7 +697,10 @@
do {
int tmp = restarter.getRandomNodeOtherNodeGroup(node1, rand());
if (tmp == -1)
- break;
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
node1 = tmp;
} while(nodesmask.get(node1));
@@ -877,12 +880,18 @@
HugoOperations hugoOps(*ctx->getTab());
Ndb* pNdb = GETNDB(step);
+ const int masterNode = restarter.getMasterNodeId();
+
int dump[] = { 7090, 20 } ;
if (restarter.dumpStateAllNodes(dump, 2))
return NDBT_FAILED;
NdbSleep_MilliSleep(3000);
-
+ Vector<int> nodes;
+ for (Uint32 i = 0; i<restarter.getNumDbNodes(); i++)
+ nodes.push_back(restarter.getDbNodeId(i));
+
+retry:
if(hugoOps.startTransaction(pNdb) != 0)
return NDBT_FAILED;
@@ -892,17 +901,28 @@
if (hugoOps.execute_NoCommit(pNdb) != 0)
return NDBT_FAILED;
- int nodeId;
const int node = hugoOps.getTransaction()->getConnectedNodeId();
+ if (node != masterNode)
+ {
+ hugoOps.closeTransaction(pNdb);
+ goto retry;
+ }
+
+ int nodeId;
do {
nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
} while (nodeId == node);
- if (restarter.insertErrorInAllNodes(7030))
- return NDBT_FAILED;
-
+ ndbout_c("7031 to %d", nodeId);
if (restarter.insertErrorInNode(nodeId, 7031))
return NDBT_FAILED;
+
+ for (Uint32 i = 0; i<nodes.size(); i++)
+ {
+ if (nodes[i] != nodeId)
+ if (restarter.insertErrorInNode(nodes[i], 7030))
+ return NDBT_FAILED;
+ }
NdbSleep_MilliSleep(500);
@@ -990,7 +1010,129 @@
if (restarter.waitNodesStarted(nodes, 2))
return NDBT_FAILED;
}
+
+ return NDBT_OK;
+}
+int
+runBug21271(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+ HugoOperations hugoOps(*ctx->getTab());
+ Ndb* pNdb = GETNDB(step);
+
+ const int masterNode = restarter.getMasterNodeId();
+ const int nodeId = restarter.getRandomNodeSameNodeGroup(masterNode, rand());
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ if (restarter.dumpStateOneNode(nodeId, val2, 2))
+ return NDBT_FAILED;
+
+ Uint32 tableId = ctx->getTab()->getTableId();
+ int dump[] = { DumpStateOrd::LqhErrorInsert5042, 0, 5044 };
+ dump[1] = tableId;
+
+ if (restarter.dumpStateOneNode(nodeId, dump, 3))
+ return NDBT_FAILED;
+
+ restarter.waitNodesNoStart(&nodeId, 1);
+ ctx->stopTest();
+
+ restarter.startNodes(&nodeId, 1);
+
+ if (restarter.waitClusterStarted() != 0)
+ return NDBT_FAILED;
+
+ return NDBT_OK;
+ return NDBT_OK;
+}
+
+int
+runBug24543(NDBT_Context* ctx, NDBT_Step* step){
+ NdbRestarter restarter;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ if (restarter.dumpStateAllNodes(val2, 2))
+ return NDBT_FAILED;
+
+ int nodes[2];
+ nodes[0] = restarter.getMasterNodeId();
+ restarter.insertErrorInNode(nodes[0], 934);
+
+ nodes[1] = restarter.getRandomNodeOtherNodeGroup(nodes[0], rand());
+ if (nodes[1] == -1)
+ {
+ nodes[1] = restarter.getRandomNodeSameNodeGroup(nodes[0], rand());
+ }
+
+ restarter.restartOneDbNode(nodes[1], false, true, true);
+ if (restarter.waitNodesNoStart(nodes, 2))
+ return NDBT_FAILED;
+
+ restarter.startNodes(nodes, 2);
+ if (restarter.waitNodesStarted(nodes, 2))
+ {
+ return NDBT_FAILED;
+ }
+ return NDBT_OK;
+}
+
+int runBug25468(NDBT_Context* ctx, NDBT_Step* step){
+
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+
+ for (int i = 0; i<loops; i++)
+ {
+ int master = restarter.getMasterNodeId();
+ int node1, node2;
+ switch(i % 5){
+ case 0:
+ node1 = master;
+ node2 = restarter.getRandomNodeSameNodeGroup(master, rand());
+ break;
+ case 1:
+ node1 = restarter.getRandomNodeSameNodeGroup(master, rand());
+ node2 = master;
+ break;
+ case 2:
+ case 3:
+ case 4:
+ node1 = restarter.getRandomNodeOtherNodeGroup(master, rand());
+ if (node1 == -1)
+ node1 = master;
+ node2 = restarter.getRandomNodeSameNodeGroup(node1, rand());
+ break;
+ }
+
+ ndbout_c("node1: %d node2: %d master: %d", node1, node2, master);
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+
+ if (restarter.dumpStateOneNode(node2, val2, 2))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInNode(node1, 7178))
+ return NDBT_FAILED;
+
+ int val1 = 7099;
+ if (restarter.dumpStateOneNode(master, &val1, 1))
+ return NDBT_FAILED;
+
+ if (restarter.waitNodesNoStart(&node2, 1))
+ return NDBT_FAILED;
+
+ if (restarter.startAll())
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterStarted())
+ return NDBT_FAILED;
+ }
+
return NDBT_OK;
}
@@ -1044,6 +1186,100 @@
return NDBT_OK;
}
+int runBug25984(NDBT_Context* ctx, NDBT_Step* step){
+
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter restarter;
+
+ if (restarter.getNumDbNodes() < 2)
+ return NDBT_OK;
+
+ if (restarter.restartAll(true, true, true))
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterNoStart())
+ return NDBT_FAILED;
+
+ if (restarter.startAll())
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterStarted())
+ return NDBT_FAILED;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ int master = restarter.getMasterNodeId();
+ int victim = restarter.getRandomNodeOtherNodeGroup(master, rand());
+ if (victim == -1)
+ victim = restarter.getRandomNodeSameNodeGroup(master, rand());
+
+ restarter.restartOneDbNode(victim, false, true, true);
+
+ for (Uint32 i = 0; i<6; i++)
+ {
+ ndbout_c("Loop: %d", i);
+ if (restarter.waitNodesNoStart(&victim, 1))
+ return NDBT_FAILED;
+
+ if (restarter.dumpStateOneNode(victim, val2, 2))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInNode(victim, 7016))
+ return NDBT_FAILED;
+
+ if (restarter.startNodes(&victim, 1))
+ return NDBT_FAILED;
+
+ NdbSleep_SecSleep(3);
+ }
+
+ if (restarter.waitNodesNoStart(&victim, 1))
+ return NDBT_FAILED;
+
+ if (restarter.dumpStateOneNode(victim, val2, 2))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInNode(victim, 7170))
+ return NDBT_FAILED;
+
+ if (restarter.startNodes(&victim, 1))
+ return NDBT_FAILED;
+
+ if (restarter.waitNodesNoStart(&victim, 1))
+ return NDBT_FAILED;
+
+ if (restarter.restartAll(false, true, true))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInAllNodes(932))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInNode(master, 7170))
+ return NDBT_FAILED;
+
+ if (restarter.dumpStateAllNodes(val2, 2))
+ return NDBT_FAILED;
+
+ restarter.startNodes(&master, 1);
+ NdbSleep_MilliSleep(3000);
+ restarter.startAll();
+
+ if (restarter.waitClusterNoStart())
+ return NDBT_FAILED;
+
+ if (restarter.restartOneDbNode(victim, true, true, true))
+ return NDBT_FAILED;
+
+ if (restarter.startAll())
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterStarted())
+ return NDBT_FAILED;
+
+ return NDBT_OK;
+}
+
int
runBug26457(NDBT_Context* ctx, NDBT_Step* step)
{
@@ -1080,7 +1316,7 @@
if (res.waitClusterStarted())
return NDBT_FAILED;
}
-
+
return NDBT_OK;
}
@@ -1124,6 +1360,68 @@
return NDBT_OK;
}
+int
+runBug26450(NDBT_Context* ctx, NDBT_Step* step)
+{
+ Uint32 i;
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter res;
+ Ndb* pNdb = GETNDB(step);
+
+ int node = res.getRandomNotMasterNodeId(rand());
+ Vector<int> nodes;
+ for (unsigned i = 0; i<res.getNumDbNodes(); i++)
+ {
+ if (res.getDbNodeId(i) != node)
+ nodes.push_back(res.getDbNodeId(i));
+ }
+
+ if (res.restartAll())
+ return NDBT_FAILED;
+
+ if (res.waitClusterStarted())
+ return NDBT_FAILED;
+
+ ndbout_c("node: %d", node);
+ if (res.restartOneDbNode(node, false, true, true))
+ return NDBT_FAILED;
+
+ if (res.waitNodesNoStart(&node, 1))
+ return NDBT_FAILED;
+
+ if (runClearTable(ctx, step))
+ return NDBT_FAILED;
+
+ for (i = 0; i < 2; i++)
+ {
+ if (res.restartAll(false, true, i > 0))
+ return NDBT_FAILED;
+
+ if (res.waitClusterNoStart())
+ return NDBT_FAILED;
+
+ if (res.startNodes(nodes.getBase(), nodes.size()))
+ return NDBT_FAILED;
+
+ if (res.waitNodesStarted(nodes.getBase(), nodes.size()))
+ return NDBT_FAILED;
+ }
+
+ if (res.startNodes(&node, 1))
+ return NDBT_FAILED;
+
+ if (res.waitNodesStarted(&node, 1))
+ return NDBT_FAILED;
+
+ HugoTransactions trans (* ctx->getTab());
+ if (trans.selectCount(pNdb) != 0)
+ return NDBT_FAILED;
+
+ return NDBT_OK;
+}
+
int
runBug27003(NDBT_Context* ctx, NDBT_Step* step)
{
@@ -1136,7 +1434,7 @@
int node = res.getRandomNotMasterNodeId(rand());
ndbout_c("node: %d", node);
- if (res.restartOneDbNode(node, false, true, true))
+ if (res.restartOneDbNode(node, true, true, true))
return NDBT_FAILED;
Uint32 pos = 0;
@@ -1155,7 +1453,7 @@
if (res.insertErrorInNode(node, errnos[pos]))
return NDBT_FAILED;
- int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 3 };
if (res.dumpStateOneNode(node, val2, 2))
return NDBT_FAILED;
@@ -1531,20 +1829,41 @@
STEP(runBug20185);
FINALIZER(runClearTable);
}
+TESTCASE("Bug24543", "")
+{
+ INITIALIZER(runBug24543);
+}
+TESTCASE("Bug21271",
+ ""){
+ INITIALIZER(runLoadTable);
+ STEP(runBug21271);
+ STEP(runPkUpdateUntilStopped);
+ FINALIZER(runClearTable);
+}
TESTCASE("Bug24717", ""){
INITIALIZER(runBug24717);
}
TESTCASE("Bug25364", ""){
INITIALIZER(runBug25364);
}
+TESTCASE("Bug25468", ""){
+ INITIALIZER(runBug25468);
+}
TESTCASE("Bug25554", ""){
INITIALIZER(runBug25554);
}
+TESTCASE("Bug25984", ""){
+ INITIALIZER(runBug25984);
+}
TESTCASE("Bug26457", ""){
INITIALIZER(runBug26457);
}
TESTCASE("Bug26481", ""){
INITIALIZER(runBug26481);
+}
+TESTCASE("Bug26450", ""){
+ INITIALIZER(runLoadTable);
+ INITIALIZER(runBug26450);
}
TESTCASE("Bug27003", ""){
INITIALIZER(runBug27003);
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.2497) | tomas | 22 Mar |