diff options
author | unknown <joreland@mysql.com> | 2004-07-07 13:40:53 +0200 |
---|---|---|
committer | unknown <joreland@mysql.com> | 2004-07-07 13:40:53 +0200 |
commit | abf8c93d80111a3dc9f31a8033f75707b2cc28ff (patch) | |
tree | f1f066a3f940fa6d5e27d2453e3832a79fd73a69 /ndb/test | |
parent | 7992ae4239a283964c0fb940ab9dde03bdf3d620 (diff) | |
download | mariadb-git-abf8c93d80111a3dc9f31a8033f75707b2cc28ff.tar.gz |
testIndex -n NFNR1
Bugs in scan(tc)
nf-handling(api)
exec-handling(tc)
ndb/include/ndbapi/NdbConnection.hpp:
Allow dropped signal during NF handling
ndb/include/ndbapi/NdbOperation.hpp:
Add option to allow dropped signals
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
1) Printer for state
2) New option to sendtckeyconf (index)
- clear exec flag
3) Moved init of *global* apiConnectptr to
prevent errornous scan_tabconf
ARGH!!!
ndb/src/ndbapi/NdbConnection.cpp:
Move abort from checkState_trans
since it can be ok with "illegal" signals during NF handling
ndb/src/ndbapi/NdbConnectionScan.cpp:
Move abort from checkState_trans
since it can be ok with "illegal" signals during NF handling
ndb/src/ndbapi/Ndbif.cpp:
1) Indentation
2) Better handling of TCKEY_FAILCONF
- always ack commit ack marker
even if transaction has already been removed
3) abort on 4012 (VM_TRACE)
ndb/src/ndbapi/TransporterFacade.cpp:
Don't trace APIREG_REQ/CONF by default
ndb/test/include/NDBT_Test.hpp:
Atomic decProperty (used for semaphore impl.)
ndb/test/ndbapi/testIndex.cpp:
Impl. option to sync restarts
ndb/test/src/NDBT_Test.cpp:
Atomic decProperty
Diffstat (limited to 'ndb/test')
-rw-r--r-- | ndb/test/include/NDBT_Test.hpp | 2 | ||||
-rw-r--r-- | ndb/test/ndbapi/testIndex.cpp | 43 | ||||
-rw-r--r-- | ndb/test/src/NDBT_Test.cpp | 12 |
3 files changed, 54 insertions, 3 deletions
diff --git a/ndb/test/include/NDBT_Test.hpp b/ndb/test/include/NDBT_Test.hpp index 7a5d14689bc..2f47c366f4e 100644 --- a/ndb/test/include/NDBT_Test.hpp +++ b/ndb/test/include/NDBT_Test.hpp @@ -63,6 +63,8 @@ public: bool getPropertyWait(const char*, Uint32); const char* getPropertyWait(const char*, const char* ); + void decProperty(const char *); + // Communicate with other tests void stopTest(); bool isTestStopped(); diff --git a/ndb/test/ndbapi/testIndex.cpp b/ndb/test/ndbapi/testIndex.cpp index d93c7f6a8a0..566da7a939d 100644 --- a/ndb/test/ndbapi/testIndex.cpp +++ b/ndb/test/ndbapi/testIndex.cpp @@ -381,6 +381,25 @@ runVerifyIndex(NDBT_Context* ctx, NDBT_Step* step){ } int +sync_down(NDBT_Context* ctx){ + Uint32 threads = ctx->getProperty("PauseThreads", (unsigned)0); + if(threads){ + ctx->decProperty("PauseThreads"); + } +} + +int +sync_up_and_wait(NDBT_Context* ctx){ + Uint32 threads = ctx->getProperty("Threads", (unsigned)0); + ndbout_c("Setting PauseThreads to %d", threads); + ctx->setProperty("PauseThreads", threads); + ctx->getPropertyWait("PauseThreads", (unsigned)0); + if(threads){ + ndbout_c("wait completed"); + } +} + +int runTransactions1(NDBT_Context* ctx, NDBT_Step* step){ // Verify that data in index match // table data @@ -394,10 +413,17 @@ runTransactions1(NDBT_Context* ctx, NDBT_Step* step){ g_err << "Updated table failed" << endl; return NDBT_FAILED; } + + sync_down(ctx); + if(ctx->isTestStopped()) + break; + if (hugoTrans.scanUpdateRecords(pNdb, rows, batchSize) != 0){ g_err << "Updated table failed" << endl; return NDBT_FAILED; } + + sync_down(ctx); } return NDBT_OK; } @@ -418,7 +444,7 @@ runTransactions2(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; } #endif - + sync_down(ctx); if(ctx->isTestStopped()) break; #if 1 @@ -427,6 +453,7 @@ runTransactions2(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; } #endif + sync_down(ctx); } return NDBT_OK; } @@ -447,6 +474,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ g_err << "Load table failed" << endl; return NDBT_FAILED; } + sync_down(ctx); if(ctx->isTestStopped()) break; @@ -454,7 +482,8 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ g_err << "Updated table failed" << endl; return NDBT_FAILED; } - + + sync_down(ctx); if(ctx->isTestStopped()) break; @@ -463,6 +492,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; } + sync_down(ctx); if(ctx->isTestStopped()) break; @@ -471,6 +501,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; } + sync_down(ctx); if(ctx->isTestStopped()) break; @@ -479,6 +510,7 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ return NDBT_FAILED; } + sync_down(ctx); if(ctx->isTestStopped()) break; @@ -486,12 +518,15 @@ runTransactions3(NDBT_Context* ctx, NDBT_Step* step){ g_err << "Clear table failed" << endl; return NDBT_FAILED; } + + sync_down(ctx); if(ctx->isTestStopped()) break; - + int count = -1; if(utilTrans.selectCount(pNdb, 64, &count) != 0 || count != 0) return NDBT_FAILED; + sync_down(ctx); } return NDBT_OK; } @@ -510,6 +545,7 @@ int runRestarts(NDBT_Context* ctx, NDBT_Step* step){ result = NDBT_FAILED; break; } + sync_up_and_wait(ctx); i++; } ctx->stopTest(); @@ -1259,6 +1295,7 @@ TESTCASE("CreateLoadDrop_O", TESTCASE("NFNR1", "Test that indexes are correctly maintained during node fail and node restart"){ TC_PROPERTY("LoggedIndexes", (unsigned)0); + //TC_PROPERTY("Threads", 2); INITIALIZER(runClearTable); INITIALIZER(createRandomIndex); INITIALIZER(runLoadTable); diff --git a/ndb/test/src/NDBT_Test.cpp b/ndb/test/src/NDBT_Test.cpp index 4cd2c96486b..af4e3ff3550 100644 --- a/ndb/test/src/NDBT_Test.cpp +++ b/ndb/test/src/NDBT_Test.cpp @@ -132,6 +132,17 @@ void NDBT_Context::setProperty(const char* _name, Uint32 _val){ assert(b == true); NdbMutex_Unlock(propertyMutexPtr); } +void +NDBT_Context::decProperty(const char * name){ + NdbMutex_Lock(propertyMutexPtr); + Uint32 val = 0; + if(props.get(name, &val)){ + assert(val > 0); + props.put(name, (val - 1), true); + } + NdbCondition_Broadcast(propertyCondPtr); + NdbMutex_Unlock(propertyMutexPtr); +} void NDBT_Context::setProperty(const char* _name, const char* _val){ NdbMutex_Lock(propertyMutexPtr); @@ -994,6 +1005,7 @@ int NDBT_TestSuite::execute(int argc, const char** argv){ res = executeAll(_testname); } else { testSuiteTimer.doStart(); + Ndb ndb("TEST_DB"); ndb.init(); for(int i = optind; i<argc; i++){ executeOne(argv[i], _testname); } |