summaryrefslogtreecommitdiff
path: root/ndb/test
diff options
context:
space:
mode:
authorunknown <jonas@perch.ndb.mysql.com>2006-04-03 12:09:50 +0200
committerunknown <jonas@perch.ndb.mysql.com>2006-04-03 12:09:50 +0200
commit063a0027059eeba1259f298b35d3356aa846343b (patch)
tree2433c28bae31dae6d42900934aa5a7e62ae71ddd /ndb/test
parent3f5bfe4fc0628fce077575ab1247abcc24875a41 (diff)
downloadmariadb-git-063a0027059eeba1259f298b35d3356aa846343b.tar.gz
ndb - bug#18612 - partitioned startup
add testprg for SR case aswell ndb/test/ndbapi/testNodeRestart.cpp: Test also partitioned start during SR ndb/test/run-test/daily-basic-tests.txt: Test also partitioned start during SR
Diffstat (limited to 'ndb/test')
-rw-r--r--ndb/test/ndbapi/testNodeRestart.cpp96
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt6
2 files changed, 101 insertions, 1 deletions
diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp
index bdf0069aa26..d297527ac8b 100644
--- a/ndb/test/ndbapi/testNodeRestart.cpp
+++ b/ndb/test/ndbapi/testNodeRestart.cpp
@@ -772,6 +772,96 @@ runBug18612(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK;
}
+int
+runBug18612SR(NDBT_Context* ctx, NDBT_Step* step){
+
+ // Assume two replicas
+ NdbRestarter restarter;
+ if (restarter.getNumDbNodes() < 2)
+ {
+ ctx->stopTest();
+ return NDBT_OK;
+ }
+
+ Uint32 cnt = restarter.getNumDbNodes();
+
+ for(int loop = 0; loop < ctx->getNumLoops(); loop++)
+ {
+ int partition0[256];
+ int partition1[256];
+ bzero(partition0, sizeof(partition0));
+ bzero(partition1, sizeof(partition1));
+ Bitmask<4> nodesmask;
+
+ Uint32 node1 = restarter.getDbNodeId(rand()%cnt);
+ for (Uint32 i = 0; i<cnt/2; i++)
+ {
+ do {
+ node1 = restarter.getRandomNodeOtherNodeGroup(node1, rand());
+ } while(nodesmask.get(node1));
+
+ partition0[i] = node1;
+ partition1[i] = restarter.getRandomNodeSameNodeGroup(node1, rand());
+
+ ndbout_c("nodes %d %d", node1, partition1[i]);
+
+ assert(!nodesmask.get(node1));
+ assert(!nodesmask.get(partition1[i]));
+ nodesmask.set(node1);
+ nodesmask.set(partition1[i]);
+ }
+
+ ndbout_c("done");
+
+ if (restarter.restartAll(false, true, false))
+ return NDBT_FAILED;
+
+ int dump[255];
+ dump[0] = 9000;
+ memcpy(dump + 1, partition0, sizeof(int)*cnt/2);
+ for (Uint32 i = 0; i<cnt/2; i++)
+ if (restarter.dumpStateOneNode(partition1[i], dump, 1+cnt/2))
+ return NDBT_FAILED;
+
+ dump[0] = 9000;
+ memcpy(dump + 1, partition1, sizeof(int)*cnt/2);
+ for (Uint32 i = 0; i<cnt/2; i++)
+ if (restarter.dumpStateOneNode(partition0[i], dump, 1+cnt/2))
+ return NDBT_FAILED;
+
+ int val2[] = { DumpStateOrd::CmvmiSetRestartOnErrorInsert, 1 };
+
+ if (restarter.dumpStateAllNodes(val2, 2))
+ return NDBT_FAILED;
+
+ if (restarter.insertErrorInAllNodes(932))
+ return NDBT_FAILED;
+
+ if (restarter.startAll())
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterStartPhase(2))
+ return NDBT_FAILED;
+
+ dump[0] = 9001;
+ for (Uint32 i = 0; i<cnt/2; i++)
+ if (restarter.dumpStateAllNodes(dump, 2))
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterNoStart(30))
+ if (restarter.waitNodesNoStart(partition0, cnt/2, 10))
+ if (restarter.waitNodesNoStart(partition1, cnt/2, 10))
+ return NDBT_FAILED;
+
+ if (restarter.startAll())
+ return NDBT_FAILED;
+
+ if (restarter.waitClusterStarted())
+ return NDBT_FAILED;
+ }
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad",
@@ -1073,6 +1163,12 @@ TESTCASE("Bug18612",
STEP(runBug18612);
FINALIZER(runClearTable);
}
+TESTCASE("Bug18612SR",
+ "Test bug with partitioned clusters"){
+ INITIALIZER(runLoadTable);
+ STEP(runBug18612SR);
+ FINALIZER(runClearTable);
+}
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 1e9bad1b969..508bf4c3d1e 100644
--- a/ndb/test/run-test/daily-basic-tests.txt
+++ b/ndb/test/run-test/daily-basic-tests.txt
@@ -462,10 +462,14 @@ max-time: 1000
cmd: testNodeRestart
args: -n Bug18414 T1
-max-time: 500
+max-time: 1000
cmd: testNodeRestart
args: -n Bug18612 T1
+max-time: 1000
+cmd: testNodeRestart
+args: -n Bug18612SR T1
+
# OLD FLEX
max-time: 500
cmd: flexBench