mirror of
https://github.com/MariaDB/server.git
synced 2026-05-04 14:15:33 +02:00
ndb - Fix problem with parallelism < fragcount & committedread
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
Pre book fragments to keep count how many ops need to be continued by
api
ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
Pre book fragments to keep count how many ops need to be continued by
api
Fixes problem with parallelism < fragcount && committed read
ndb/test/ndbapi/testScan.cpp:
new testcase for scan parallelism
ndb/test/run-test/daily-basic-tests.txt:
Run new testcase
ndb/test/src/HugoTransactions.cpp:
Use parallelism parameter
This commit is contained in:
parent
124bc850d5
commit
8296883ff4
5 changed files with 63 additions and 7 deletions
|
|
@ -1065,6 +1065,44 @@ int runScanRestart(NDBT_Context* ctx, NDBT_Step* step){
|
|||
}
|
||||
|
||||
|
||||
int
|
||||
runScanParallelism(NDBT_Context* ctx, NDBT_Step* step){
|
||||
int loops = ctx->getNumLoops() + 3;
|
||||
int records = ctx->getNumRecords();
|
||||
int abort = ctx->getProperty("AbortProb", 15);
|
||||
|
||||
Uint32 fib[] = { 1, 2 };
|
||||
Uint32 parallelism = 0; // start with 0
|
||||
int i = 0;
|
||||
HugoTransactions hugoTrans(*ctx->getTab());
|
||||
while (i<loops && !ctx->isTestStopped()) {
|
||||
g_info << i << ": ";
|
||||
|
||||
if (hugoTrans.scanReadRecords(GETNDB(step), records, abort, parallelism,
|
||||
NdbOperation::LM_Read) != 0){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
if (hugoTrans.scanReadRecords(GETNDB(step), records, abort, parallelism,
|
||||
NdbOperation::LM_Exclusive) != 0){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
if (hugoTrans.scanReadRecords(GETNDB(step), records, abort, parallelism,
|
||||
NdbOperation::LM_CommittedRead) != 0){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
if (hugoTrans.scanUpdateRecords(GETNDB(step), records, abort, parallelism)
|
||||
!= 0){
|
||||
return NDBT_FAILED;
|
||||
}
|
||||
i++;
|
||||
parallelism = fib[0];
|
||||
Uint32 next = fib[0] + fib[1];
|
||||
fib[0] = fib[1];
|
||||
fib[1] = next;
|
||||
}
|
||||
return NDBT_OK;
|
||||
}
|
||||
|
||||
NDBT_TESTSUITE(testScan);
|
||||
TESTCASE("ScanRead",
|
||||
"Verify scan requirement: It should be possible "\
|
||||
|
|
@ -1515,6 +1553,12 @@ TESTCASE("ScanRestart",
|
|||
STEP(runScanRestart);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
TESTCASE("ScanParallelism",
|
||||
"Test scan with different parallelism"){
|
||||
INITIALIZER(runLoadTable);
|
||||
STEP(runScanParallelism);
|
||||
FINALIZER(runClearTable);
|
||||
}
|
||||
NDBT_TESTSUITE_END(testScan);
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue