summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.mysql.com>2007-03-21 16:35:40 +0100
committerunknown <tomas@poseidon.mysql.com>2007-03-21 16:35:40 +0100
commit68d074d07377bc020c08022c1fcc5e0b6bd1b590 (patch)
tree19f28c844c6397f92f35a93a676e544a7ea5f003 /ndb
parentf8a071d38d73cf887238b0bea99693940de9fe4b (diff)
parentf58baa6a28afbe0d03e8fc7ce713388ff6718a2a (diff)
downloadmariadb-git-68d074d07377bc020c08022c1fcc5e0b6bd1b590.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into poseidon.mysql.com:/home/tomas/mysql-5.0-ndb
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/ERROR_codes.txt14
-rw-r--r--ndb/src/kernel/blocks/dbdih/DbdihMain.cpp32
-rw-r--r--ndb/src/kernel/blocks/dblqh/DblqhMain.cpp19
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp24
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupGen.cpp2
-rw-r--r--ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp1
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp2
-rw-r--r--ndb/src/mgmsrv/MgmtSrvr.cpp2
-rw-r--r--ndb/test/ndbapi/testNodeRestart.cpp101
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt8
-rw-r--r--ndb/test/src/UtilTransactions.cpp1
11 files changed, 197 insertions, 9 deletions
diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt
index f7cb49014cb..9c2b441e7be 100644
--- a/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -5,7 +5,7 @@ Next DBACC 3002
Next DBTUP 4014
Next DBLQH 5043
Next DBDICT 6007
-Next DBDIH 7181
+Next DBDIH 7183
Next DBTC 8039
Next CMVMI 9000
Next BACKUP 10022
@@ -489,3 +489,15 @@ Dbdict:
6003 Crash in participant @ CreateTabReq::Prepare
6004 Crash in participant @ CreateTabReq::Commit
6005 Crash in participant @ CreateTabReq::CreateDrop
+
+TUP:
+----
+
+4025: Fail all inserts with out of memory
+4026: Fail one insert with oom
+4027: Fail inserts randomly with oom
+4028: Fail one random insert with oom
+
+NDBCNTR:
+
+1000: Crash insertion on SystemError::CopyFragRef
diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
index 160a5fc135a..44cfa344ab3 100644
--- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
+++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
@@ -4811,6 +4811,15 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal)
} else {
ndbrequire(failedNodePtr.p->nodeStatus == NodeRecord::DYING);
}//if
+
+ if (ERROR_INSERTED(7181))
+ {
+ ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ");
+ CLEAR_ERROR_INSERT_VALUE;
+ signal->theData[1] = coldgcp;
+ execGCP_TCFINISHED(signal);
+ }
+
MasterGCPConf::State gcpState;
switch (cgcpParticipantState) {
case GCP_PARTICIPANT_READY:
@@ -4877,6 +4886,14 @@ void Dbdih::execMASTER_GCPREQ(Signal* signal)
masterGCPConf->lcpActive[i] = SYSFILE->lcpActive[i];
sendSignal(newMasterBlockref, GSN_MASTER_GCPCONF, signal,
MasterGCPConf::SignalLength, JBB);
+
+ if (ERROR_INSERTED(7182))
+ {
+ ndbout_c("execGCP_TCFINISHED in MASTER_GCPREQ");
+ CLEAR_ERROR_INSERT_VALUE;
+ signal->theData[1] = coldgcp;
+ execGCP_TCFINISHED(signal);
+ }
}//Dbdih::execMASTER_GCPREQ()
void Dbdih::execMASTER_GCPCONF(Signal* signal)
@@ -7549,10 +7566,10 @@ void Dbdih::execGCP_NODEFINISH(Signal* signal)
} else if (cmasterState == MASTER_TAKE_OVER_GCP) {
jam();
//-------------------------------------------------------------
- // We are currently taking over as master. We will delay the
- // signal until we have completed the take over gcp handling.
+ // We are currently taking over as master. Ignore
+ // signal in this case since we will discover it in reception of
+ // MASTER_GCPCONF.
//-------------------------------------------------------------
- sendSignalWithDelay(reference(), GSN_GCP_NODEFINISH, signal, 20, 3);
return;
} else {
ndbrequire(cmasterState == MASTER_ACTIVE);
@@ -7699,6 +7716,15 @@ void Dbdih::execGCP_TCFINISHED(Signal* signal)
Uint32 gci = signal->theData[1];
ndbrequire(gci == coldgcp);
+ if (ERROR_INSERTED(7181) || ERROR_INSERTED(7182))
+ {
+ ndbout_c("killing %d", refToNode(cmasterdihref));
+ signal->theData[0] = 9999;
+ sendSignal(numberToRef(CMVMI, refToNode(cmasterdihref)),
+ GSN_NDB_TAMPER, signal, 1, JBB);
+ return;
+ }
+
cgcpParticipantState = GCP_PARTICIPANT_TC_FINISHED;
signal->theData[0] = cownNodeId;
signal->theData[1] = coldgcp;
diff --git a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
index d73d15f416f..9944adf4ede 100644
--- a/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
+++ b/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
@@ -9634,6 +9634,15 @@ void Dblqh::copyCompletedLab(Signal* signal)
closeCopyLab(signal);
return;
}//if
+
+ if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY &&
+ scanptr.p->scanErrorCounter)
+ {
+ jam();
+ closeCopyLab(signal);
+ return;
+ }
+
if (scanptr.p->scanState == ScanRecord::WAIT_LQHKEY_COPY) {
jam();
/*---------------------------------------------------------------------------*/
@@ -9710,13 +9719,16 @@ void Dblqh::continueCopyAfterBlockedLab(Signal* signal)
void Dblqh::copyLqhKeyRefLab(Signal* signal)
{
ndbrequire(tcConnectptr.p->transid[1] == signal->theData[4]);
- tcConnectptr.p->copyCountWords -= signal->theData[3];
+ Uint32 copyWords = signal->theData[3];
scanptr.i = tcConnectptr.p->tcScanRec;
c_scanRecordPool.getPtr(scanptr);
scanptr.p->scanErrorCounter++;
tcConnectptr.p->errorCode = terrorCode;
- closeCopyLab(signal);
- return;
+
+ LqhKeyConf* conf = (LqhKeyConf*)signal->getDataPtrSend();
+ conf->transId1 = copyWords;
+ conf->transId2 = tcConnectptr.p->transid[1];
+ copyCompletedLab(signal);
}//Dblqh::copyLqhKeyRefLab()
void Dblqh::closeCopyLab(Signal* signal)
@@ -9727,6 +9739,7 @@ void Dblqh::closeCopyLab(Signal* signal)
// Wait until all of those have arrived until we start the
// close process.
/*---------------------------------------------------------------------------*/
+ scanptr.p->scanState = ScanRecord::WAIT_LQHKEY_COPY;
jam();
return;
}//if
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
index 42b86102dff..72ef9a274ec 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp
@@ -212,6 +212,30 @@ void Dbtup::execTUP_ALLOCREQ(Signal* signal)
//---------------------------------------------------
PagePtr pagePtr;
Uint32 pageOffset;
+
+ if (ERROR_INSERTED(4025))
+ {
+ signal->theData[0] = 827;
+ return;
+ }
+ if (ERROR_INSERTED(4026))
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ signal->theData[0] = 827;
+ return;
+ }
+ if (ERROR_INSERTED(4027) && (rand() % 100) > 25)
+ {
+ signal->theData[0] = 827;
+ return;
+ }
+ if (ERROR_INSERTED(4028) && (rand() % 100) > 25)
+ {
+ CLEAR_ERROR_INSERT_VALUE;
+ signal->theData[0] = 827;
+ return;
+ }
+
if (!allocTh(regFragPtr.p,
regTabPtr.p,
NORMAL_PAGE,
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
index 0f83c45077b..df8df2d29f3 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
@@ -65,6 +65,7 @@ void Dbtup::initData()
undoPage = 0;
totNoOfPagesAllocated = 0;
cnoOfAllocatedPages = 0;
+ CLEAR_ERROR_INSERT_VALUE;
// Records with constant sizes
}//Dbtup::initData()
@@ -568,7 +569,6 @@ void Dbtup::execSTTOR(Signal* signal)
switch (startPhase) {
case ZSTARTPHASE1:
ljam();
- CLEAR_ERROR_INSERT_VALUE;
cownref = calcTupBlockRef(0);
break;
default:
diff --git a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
index b3f35f12b52..5d34d3f1126 100644
--- a/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
+++ b/ndb/src/kernel/blocks/ndbcntr/NdbcntrMain.cpp
@@ -179,6 +179,7 @@ void Ndbcntr::execSYSTEM_ERROR(Signal* signal)
break;
case SystemError::CopyFragRefError:
+ CRASH_INSERTION(1000);
BaseString::snprintf(buf, sizeof(buf),
"Killed by node %d as "
"copyfrag failed, error: %u",
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index f4f643b0f61..0cf37b5f874 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -565,7 +565,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
true,
ConfigInfo::CI_INT,
"0",
- "1",
+ "0",
"2" },
{
diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp
index 5635d5b4420..3d7eb5bd4f1 100644
--- a/ndb/src/mgmsrv/MgmtSrvr.cpp
+++ b/ndb/src/mgmsrv/MgmtSrvr.cpp
@@ -2494,6 +2494,8 @@ MgmtSrvr::startBackup(Uint32& backupId, int waitCompleted)
ndbout_c("I'm not master resending to %d", nodeId);
#endif
do_send = 1; // try again
+ if (!theFacade->get_node_alive(nodeId))
+ m_master_node = nodeId = 0;
continue;
}
event.Event = BackupEvent::BackupFailedToStart;
diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp
index a5e787dfd0e..26c8fe35011 100644
--- a/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/ndb/test/ndbapi/testNodeRestart.cpp
@@ -1124,6 +1124,101 @@ runBug26481(NDBT_Context* ctx, NDBT_Step* step)
return NDBT_OK;
}
+int
+runBug27003(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter res;
+
+ static const int errnos[] = { 4025, 4026, 4027, 4028, 0 };
+
+ int node = res.getRandomNotMasterNodeId(rand());
+ ndbout_c("node: %d", node);
+ if (res.restartOneDbNode(node, false, true, true))
+ return NDBT_FAILED;
+
+ Uint32 pos = 0;
+ for (Uint32 i = 0; i<loops; i++)
+ {
+ while (errnos[pos] != 0)
+ {
+ ndbout_c("Tesing err: %d", errnos[pos]);
+
+ if (res.waitNodesNoStart(&node, 1))
+ return NDBT_FAILED;
+
+ if (res.insertErrorInNode(node, 1000))
+ return NDBT_FAILED;
+
+ if (res.insertErrorInNode(node, errnos[pos]))
+ return NDBT_FAILED;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+ if (res.dumpStateOneNode(node, val2, 2))
+ return NDBT_FAILED;
+
+ res.startNodes(&node, 1);
+ res.waitNodesStartPhase(&node, 1, 2);
+ pos++;
+ }
+ pos = 0;
+ }
+
+ if (res.waitNodesNoStart(&node, 1))
+ return NDBT_FAILED;
+
+ res.startNodes(&node, 1);
+ if (res.waitClusterStarted())
+ return NDBT_FAILED;
+
+ return NDBT_OK;
+}
+
+
+int
+runBug27283(NDBT_Context* ctx, NDBT_Step* step)
+{
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ NdbRestarter res;
+
+ if (res.getNumDbNodes() < 2)
+ {
+ return NDBT_OK;
+ }
+
+ static const int errnos[] = { 7181, 7182, 0 };
+
+ Uint32 pos = 0;
+ for (Uint32 i = 0; i<loops; i++)
+ {
+ while (errnos[pos] != 0)
+ {
+ int master = res.getMasterNodeId();
+ int next = res.getNextMasterNodeId(master);
+ int next2 = res.getNextMasterNodeId(next);
+
+ int node = (i & 1) ? next : next2;
+ ndbout_c("Tesing err: %d", errnos[pos]);
+ if (res.insertErrorInNode(next, errnos[pos]))
+ return NDBT_FAILED;
+
+ NdbSleep_SecSleep(3);
+
+ if (res.waitClusterStarted())
+ return NDBT_FAILED;
+
+ pos++;
+ }
+ pos = 0;
+ }
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\
@@ -1451,6 +1546,12 @@ TESTCASE("Bug26457", ""){
TESTCASE("Bug26481", ""){
INITIALIZER(runBug26481);
}
+TESTCASE("Bug27003", ""){
+ INITIALIZER(runBug27003);
+}
+TESTCASE("Bug27283", ""){
+ INITIALIZER(runBug27283);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){
diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt
index 06cd0664186..a35b2b3f7c7 100644
--- a/ndb/test/run-test/daily-basic-tests.txt
+++ b/ndb/test/run-test/daily-basic-tests.txt
@@ -425,6 +425,14 @@ max-time: 500
cmd: testScan
args: -n Bug24447 T1
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug27003 T1
+
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug27283 T1
+
max-time: 500
cmd: testNodeRestart
args: -n Bug15587 T1
diff --git a/ndb/test/src/UtilTransactions.cpp b/ndb/test/src/UtilTransactions.cpp
index 3a166f19c92..011cea24af9 100644
--- a/ndb/test/src/UtilTransactions.cpp
+++ b/ndb/test/src/UtilTransactions.cpp
@@ -1381,6 +1381,7 @@ UtilTransactions::compare(Ndb* pNdb, const char* tab_name2, int flags){
goto error;
}
+ row_count= 0;
{
int eof;
while((eof = pOp->nextResult(true)) == 0)