summaryrefslogtreecommitdiff
path: root/ndb/test/ndbapi/testNodeRestart.cpp
diff options
context:
space:
mode:
authorunknown <joreland@mysql.com>2004-10-08 17:44:20 +0200
committerunknown <joreland@mysql.com>2004-10-08 17:44:20 +0200
commita50ec67648a48c8029860cdaaddc54eccf96cddf (patch)
tree6722161ec5b52777c635ebe455ed1d2afc6bb745 /ndb/test/ndbapi/testNodeRestart.cpp
parent1996eb651ad0d14557caa8195adf34993ca70e54 (diff)
downloadmariadb-git-a50ec67648a48c8029860cdaaddc54eccf96cddf.tar.gz
wl 1801
Testcases for NF ndb/src/kernel/blocks/ERROR_codes.txt: Error insert for testing NF handling of committed read ndb/src/kernel/blocks/dblqh/DblqhMain.cpp: Error insert for testing NF handling of committed read ndb/src/kernel/blocks/dbtc/DbtcMain.cpp: Error insert for testing NF handling of committed read ndb/test/include/NDBT_Test.hpp: Move sync methods into NDBT_Context ndb/test/ndbapi/testIndex.cpp: Move sync methods into NDBT_Context ndb/test/ndbapi/testNodeRestart.cpp: Add test case that verifies committed read during NF ndb/test/src/NDBT_Test.cpp: Move sync methods into NDBT_Context
Diffstat (limited to 'ndb/test/ndbapi/testNodeRestart.cpp')
-rw-r--r--ndb/test/ndbapi/testNodeRestart.cpp37
1 files changed, 35 insertions, 2 deletions
diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp
index 81193d671b6..0ba0d170984 100644
--- a/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/ndb/test/ndbapi/testNodeRestart.cpp
@@ -219,6 +219,7 @@ int runScanReadVerify(NDBT_Context* ctx, NDBT_Step* step){
int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
int loops = ctx->getNumLoops();
+ int sync_threads = ctx->getProperty("SyncThreads", (unsigned)0);
NdbRestarter restarter;
int i = 0;
int lastId = 0;
@@ -235,7 +236,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
loops *= restarter.getNumDbNodes();
while(i<loops && result != NDBT_FAILED && !ctx->isTestStopped()){
-
+
int id = lastId % restarter.getNumDbNodes();
int nodeId = restarter.getDbNodeId(id);
ndbout << "Restart node " << nodeId << endl;
@@ -251,7 +252,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
break;
}
- NdbSleep_SecSleep(1);
+ ctx->sync_up_and_wait("PauseThreads", sync_threads);
lastId++;
i++;
@@ -295,6 +296,32 @@ int runRestarts(NDBT_Context* ctx, NDBT_Step* step){
return result;
}
+int runDirtyRead(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ NdbRestarter restarter;
+ HugoTransactions hugoTrans(*ctx->getTab());
+
+ int i = 0;
+ while(i<loops && result != NDBT_FAILED && !ctx->isTestStopped()){
+ g_info << i << ": ";
+
+ int id = i % restarter.getNumDbNodes();
+ int nodeId = restarter.getDbNodeId(id);
+ ndbout << "Restart node " << nodeId << endl;
+ restarter.insertErrorInNode(nodeId, 5041);
+ restarter.insertErrorInAllNodes(8048);
+
+ if (hugoTrans.pkReadRecords(GETNDB(step), 1, 1,
+ NdbOperation::LM_CommittedRead) != 0)
+ {
+ return NDBT_FAILED;
+ }
+ i++;
+ }
+ return result;
+}
+
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
"Test that one node at a time can be stopped and then restarted "\
@@ -545,6 +572,12 @@ TESTCASE("StopOnError",
FINALIZER(runScanReadVerify);
FINALIZER(runClearTable);
}
+TESTCASE("CommittedRead",
+ "Test committed read"){
+ INITIALIZER(runLoadTable);
+ STEP(runDirtyRead);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){