Commit b52a1722 authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/50-work

into  perch.ndb.mysql.com:/home/jonas/src/51-work


storage/ndb/src/kernel/blocks/ERROR_codes.txt:
  Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Auto merged
storage/ndb/test/run-test/daily-basic-tests.txt:
  Auto merged
storage/ndb/test/ndbapi/testScan.cpp:
  merge
parents 27fac7ba 4983c584
...@@ -6,7 +6,7 @@ Next DBTUP 4024 ...@@ -6,7 +6,7 @@ Next DBTUP 4024
Next DBLQH 5045 Next DBLQH 5045
Next DBDICT 6007 Next DBDICT 6007
Next DBDIH 7178 Next DBDIH 7178
Next DBTC 8038 Next DBTC 8039
Next CMVMI 9000 Next CMVMI 9000
Next BACKUP 10036 Next BACKUP 10036
Next DBUTIL 11002 Next DBUTIL 11002
...@@ -287,6 +287,11 @@ ABORT OF TCKEYREQ ...@@ -287,6 +287,11 @@ ABORT OF TCKEYREQ
8037 : Invalid schema version in TCINDXREQ 8037 : Invalid schema version in TCINDXREQ
------
8038 : Simulate API disconnect just after SCAN_TAB_REQ
CMVMI CMVMI
----- -----
9000 Set RestartOnErrorInsert to restart -n 9000 Set RestartOnErrorInsert to restart -n
......
...@@ -8712,6 +8712,20 @@ void Dbtc::execSCAN_TABREQ(Signal* signal) ...@@ -8712,6 +8712,20 @@ void Dbtc::execSCAN_TABREQ(Signal* signal)
* IF ANY TO RECEIVE. * IF ANY TO RECEIVE.
**********************************************************/ **********************************************************/
scanptr.p->scanState = ScanRecord::WAIT_AI; scanptr.p->scanState = ScanRecord::WAIT_AI;
if (ERROR_INSERTED(8038))
{
/**
* Force API_FAILREQ
*/
DisconnectRep * const rep = (DisconnectRep *)signal->getDataPtrSend();
rep->nodeId = refToNode(apiConnectptr.p->ndbapiBlockref);
rep->err = 8038;
EXECUTE_DIRECT(CMVMI, GSN_DISCONNECT_REP, signal, 2);
CLEAR_ERROR_INSERT_VALUE;
}
return; return;
SCAN_error_check: SCAN_error_check:
...@@ -8802,6 +8816,7 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr, ...@@ -8802,6 +8816,7 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr,
jam(); jam();
ScanFragRecPtr ptr; ScanFragRecPtr ptr;
ndbrequire(list.seize(ptr)); ndbrequire(list.seize(ptr));
ptr.p->scanFragState = ScanFragRec::IDLE;
ptr.p->scanRec = scanptr.i; ptr.p->scanRec = scanptr.i;
ptr.p->scanFragId = 0; ptr.p->scanFragId = 0;
ptr.p->m_apiPtr = cdata[i]; ptr.p->m_apiPtr = cdata[i];
...@@ -9599,9 +9614,17 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ...@@ -9599,9 +9614,17 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanRecord* scanP = scanPtr.p; ScanRecord* scanP = scanPtr.p;
ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE); ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE);
ScanRecord::ScanState old = scanPtr.p->scanState;
scanPtr.p->scanState = ScanRecord::CLOSING_SCAN; scanPtr.p->scanState = ScanRecord::CLOSING_SCAN;
scanPtr.p->m_close_scan_req = req_received; scanPtr.p->m_close_scan_req = req_received;
if (old == ScanRecord::WAIT_FRAGMENT_COUNT)
{
jam();
scanPtr.p->scanState = old;
return; // Will continue on execDI_FCOUNTCONF
}
/** /**
* Queue : Action * Queue : Action
* ============= : ================= * ============= : =================
...@@ -9629,11 +9652,22 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){ ...@@ -9629,11 +9652,22 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanFragRecPtr curr = ptr; // Remove while iterating... ScanFragRecPtr curr = ptr; // Remove while iterating...
running.next(ptr); running.next(ptr);
if(curr.p->scanFragState == ScanFragRec::WAIT_GET_PRIMCONF){ switch(curr.p->scanFragState){
case ScanFragRec::IDLE:
jam(); // real early abort
ndbrequire(old == ScanRecord::WAIT_AI);
running.release(curr);
continue;
case ScanFragRec::WAIT_GET_PRIMCONF:
jam(); jam();
continue; continue;
case ScanFragRec::LQH_ACTIVE:
jam();
break;
default:
jamLine(curr.p->scanFragState);
ndbrequire(false);
} }
ndbrequire(curr.p->scanFragState == ScanFragRec::LQH_ACTIVE);
curr.p->startFragTimer(ctcTimer); curr.p->startFragTimer(ctcTimer);
curr.p->scanFragState = ScanFragRec::LQH_ACTIVE; curr.p->scanFragState = ScanFragRec::LQH_ACTIVE;
......
...@@ -641,7 +641,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -641,7 +641,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
int nodeId = restarter.getDbNodeId(lastId); int nodeId = restarter.getDbNodeId(lastId);
lastId = (lastId + 1) % restarter.getNumDbNodes(); lastId = (lastId + 1) % restarter.getNumDbNodes();
if(restarter.restartOneDbNode(nodeId) != 0){ if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){
g_err << "Failed to restartNextDbNode" << endl; g_err << "Failed to restartNextDbNode" << endl;
result = NDBT_FAILED; result = NDBT_FAILED;
break; break;
...@@ -1220,7 +1220,39 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step) ...@@ -1220,7 +1220,39 @@ runScanVariants(NDBT_Context* ctx, NDBT_Step* step)
} }
} }
} }
return NDBT_OK;
}
int
runBug24447(NDBT_Context* ctx, NDBT_Step* step){
int loops = 1; //ctx->getNumLoops();
int records = ctx->getNumRecords();
int abort = ctx->getProperty("AbortProb", 15);
NdbRestarter restarter;
HugoTransactions hugoTrans(*ctx->getTab());
int i = 0;
while (i<loops && !ctx->isTestStopped())
{
g_info << i++ << ": ";
int nodeId = restarter.getRandomNotMasterNodeId(rand());
if (nodeId == -1)
nodeId = restarter.getMasterNodeId();
if (restarter.insertErrorInNode(nodeId, 8038) != 0)
{
ndbout << "Could not insert error in node="<<nodeId<<endl;
return NDBT_FAILED;
}
for (Uint32 j = 0; i<10; i++)
{
hugoTrans.scanReadRecords(GETNDB(step), records, abort, 0,
NdbOperation::LM_CommittedRead);
}
}
restarter.insertErrorInAllNodes(0);
return NDBT_OK; return NDBT_OK;
} }
...@@ -1708,6 +1740,12 @@ TESTCASE("ScanVariants", ...@@ -1708,6 +1740,12 @@ TESTCASE("ScanVariants",
STEP(runScanVariants); STEP(runScanVariants);
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("Bug24447",
""){
INITIALIZER(runLoadTable);
STEP(runBug24447);
FINALIZER(runClearTable);
}
NDBT_TESTSUITE_END(testScan); NDBT_TESTSUITE_END(testScan);
int main(int argc, const char** argv){ int main(int argc, const char** argv){
......
...@@ -449,6 +449,10 @@ max-time: 500 ...@@ -449,6 +449,10 @@ max-time: 500
cmd: testScan cmd: testScan
args: -n ScanParallelism args: -n ScanParallelism
max-time: 500
cmd: testScan
args: -n Bug24447 T1
max-time: 500 max-time: 500
cmd: testScan cmd: testScan
args: -n ScanVariants args: -n ScanVariants
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment