diff options
author | joreland@mysql.com <> | 2005-03-01 13:35:57 +0100 |
---|---|---|
committer | joreland@mysql.com <> | 2005-03-01 13:35:57 +0100 |
commit | e9feed97514db782c0882b2fd8c7a8f9c4ad3678 (patch) | |
tree | a0141ee036dc3f84fcbb08c29780cf8c64fb5c5c /ndb/test | |
parent | 54af1b8fc889b9f461f693e2e5b152706aa4eb8f (diff) | |
parent | afdbf9b4a43cde56deabfc0912312a500edd79b7 (diff) | |
download | mariadb-git-e9feed97514db782c0882b2fd8c7a8f9c4ad3678.tar.gz |
Merge mysql.com:/home/jonas/src/fix
into mysql.com:/home/jonas/src/mysql-4.1
Diffstat (limited to 'ndb/test')
-rw-r--r-- | ndb/test/ndbapi/testNodeRestart.cpp | 71 | ||||
-rw-r--r-- | ndb/test/run-test/daily-devel-tests.txt | 4 |
2 files changed, 75 insertions, 0 deletions
diff --git a/ndb/test/ndbapi/testNodeRestart.cpp b/ndb/test/ndbapi/testNodeRestart.cpp index e844f227034..a50df91908c 100644 --- a/ndb/test/ndbapi/testNodeRestart.cpp +++ b/ndb/test/ndbapi/testNodeRestart.cpp @@ -344,6 +344,71 @@ err: return NDBT_FAILED; } +int runLateCommit(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); + + int i = 0; + while(i<loops && result != NDBT_FAILED && !ctx->isTestStopped()){ + g_info << i << ": "; + + if(hugoOps.startTransaction(pNdb) != 0) + return NDBT_FAILED; + + if(hugoOps.pkUpdateRecord(pNdb, 1) != 0) + return NDBT_FAILED; + + if(hugoOps.execute_NoCommit(pNdb) != 0) + return NDBT_FAILED; + + Uint32 transNode= hugoOps.getTransaction()->getConnectedNodeId(); + int id = i % restarter.getNumDbNodes(); + int nodeId; + while((nodeId = restarter.getDbNodeId(id)) == transNode) + id = (id + 1) % restarter.getNumDbNodes(); + + ndbout << "Restart node " << nodeId << endl; + + restarter.restartOneDbNode(nodeId, + /** initial */ false, + /** nostart */ true, + /** abort */ true); + + restarter.waitNodesNoStart(&nodeId, 1); + + int res; + if(i & 1) + res= hugoOps.execute_Commit(pNdb); + else + res= hugoOps.execute_Rollback(pNdb); + + ndbout_c("res= %d", res); + + hugoOps.closeTransaction(pNdb); + + restarter.startNodes(&nodeId, 1); + restarter.waitNodesStarted(&nodeId, 1); + + if(i & 1) + { + if(res != 286) + return NDBT_FAILED; + } + else + { + if(res != 0) + return NDBT_FAILED; + } + i++; + } + + return NDBT_OK; +} + NDBT_TESTSUITE(testNodeRestart); TESTCASE("NoLoad", "Test that one node at a time can be stopped and then restarted "\ @@ -600,6 +665,12 @@ TESTCASE("CommittedRead", STEP(runDirtyRead); FINALIZER(runClearTable); } +TESTCASE("LateCommit", + "Test commit after node failure"){ + INITIALIZER(runLoadTable); + STEP(runLateCommit); + FINALIZER(runClearTable); +} NDBT_TESTSUITE_END(testNodeRestart); int main(int argc, const char** argv){ diff --git a/ndb/test/run-test/daily-devel-tests.txt b/ndb/test/run-test/daily-devel-tests.txt index 2cdd39ffa4c..9812ec2ceaa 100644 --- a/ndb/test/run-test/daily-devel-tests.txt +++ b/ndb/test/run-test/daily-devel-tests.txt @@ -71,6 +71,10 @@ args: -n CommittedRead T1 max-time: 2500 cmd: testNodeRestart +args: -n LateCommit T1 + +max-time: 2500 +cmd: testNodeRestart args: -n Terror T6 T13 max-time: 2500 |