ndb - bug#15685

  Error in abort handling in TC when timeout during abort
  
parent 17e8f6ca
...@@ -165,6 +165,7 @@ handling in DBTC to ensure that node failures are also well handled in ...@@ -165,6 +165,7 @@ handling in DBTC to ensure that node failures are also well handled in
time-out handling. They can also be used to test multiple node failure time-out handling. They can also be used to test multiple node failure
handling. handling.
ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBLQH ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBLQH
------------------------------------------------- -------------------------------------------------
5011: 5011:
...@@ -201,6 +202,9 @@ Delay execution of ABORTREQ signal 2 seconds to generate time-out. ...@@ -201,6 +202,9 @@ Delay execution of ABORTREQ signal 2 seconds to generate time-out.
8048: Make TC not choose own node for simple/dirty read 8048: Make TC not choose own node for simple/dirty read
5041: Crash is receiving simple read from other TC on different node 5041: Crash is receiving simple read from other TC on different node
5100,5101: Drop ABORT req in primary replica
Crash on "next" ABORT
ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC ERROR CODES FOR TESTING TIME-OUT HANDLING IN DBTC
------------------------------------------------- -------------------------------------------------
8040: 8040:
......
...@@ -5870,12 +5870,21 @@ void Dblqh::execABORT(Signal* signal) ...@@ -5870,12 +5870,21 @@ void Dblqh::execABORT(Signal* signal)
warningReport(signal, 8); warningReport(signal, 8);
return; return;
}//if }//if
TcConnectionrec * const regTcPtr = tcConnectptr.p;
if (ERROR_INSERTED(5100))
{
SET_ERROR_INSERT_VALUE(5101);
return;
}
CRASH_INSERTION2(5101, regTcPtr->nextReplica != ZNIL);
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
/*A GUIDING DESIGN PRINCIPLE IN HANDLING THESE ERROR SITUATIONS HAVE BEEN */ /*A GUIDING DESIGN PRINCIPLE IN HANDLING THESE ERROR SITUATIONS HAVE BEEN */
/*KEEP IT SIMPLE. THUS WE RATHER INSERT A WAIT AND SET THE ABORT_STATE TO */ /*KEEP IT SIMPLE. THUS WE RATHER INSERT A WAIT AND SET THE ABORT_STATE TO */
/*ACTIVE RATHER THAN WRITE NEW CODE TO HANDLE EVERY SPECIAL SITUATION. */ /*ACTIVE RATHER THAN WRITE NEW CODE TO HANDLE EVERY SPECIAL SITUATION. */
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
TcConnectionrec * const regTcPtr = tcConnectptr.p;
if (regTcPtr->nextReplica != ZNIL) { if (regTcPtr->nextReplica != ZNIL) {
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */
// We will immediately send the ABORT message also to the next LQH node in line. // We will immediately send the ABORT message also to the next LQH node in line.
......
...@@ -6129,7 +6129,6 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr) ...@@ -6129,7 +6129,6 @@ void Dbtc::timeOutFoundLab(Signal* signal, Uint32 TapiConPtr)
<< " - place: " << c_apiConTimer_line[apiConnectptr.i]); << " - place: " << c_apiConTimer_line[apiConnectptr.i]);
switch (apiConnectptr.p->apiConnectstate) { switch (apiConnectptr.p->apiConnectstate) {
case CS_STARTED: case CS_STARTED:
ndbrequire(c_apiConTimer_line[apiConnectptr.i] != 3615);
if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){ if(apiConnectptr.p->lqhkeyreqrec == apiConnectptr.p->lqhkeyconfrec){
jam(); jam();
/* /*
...@@ -6389,8 +6388,8 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck) ...@@ -6389,8 +6388,8 @@ void Dbtc::sendAbortedAfterTimeout(Signal* signal, int Tcheck)
warningEvent(buf); warningEvent(buf);
ndbout_c(buf); ndbout_c(buf);
ndbrequire(false); ndbrequire(false);
releaseAbortResources(signal);
} }
releaseAbortResources(signal);
return; return;
}//if }//if
TloopCount++; TloopCount++;
......
...@@ -496,6 +496,45 @@ int runBug15632(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -496,6 +496,45 @@ int runBug15632(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_OK; return NDBT_OK;
} }
int runBug15685(NDBT_Context* ctx, NDBT_Step* step){
Ndb* pNdb = GETNDB(step);
HugoOperations hugoOps(*ctx->getTab());
NdbRestarter restarter;
HugoTransactions hugoTrans(*ctx->getTab());
if (hugoTrans.loadTable(GETNDB(step), 10) != 0){
return NDBT_FAILED;
}
if(hugoOps.startTransaction(pNdb) != 0)
goto err;
if(hugoOps.pkUpdateRecord(pNdb, 0, 1, rand()) != 0)
goto err;
if(hugoOps.execute_NoCommit(pNdb) != 0)
goto err;
if (restarter.insertErrorInAllNodes(5100))
return NDBT_FAILED;
hugoOps.execute_Rollback(pNdb);
if (restarter.waitClusterStarted() != 0)
goto err;
if (restarter.insertErrorInAllNodes(0))
return NDBT_FAILED;
ctx->stopTest();
return NDBT_OK;
err:
ctx->stopTest();
return NDBT_FAILED;
}
NDBT_TESTSUITE(testNodeRestart); NDBT_TESTSUITE(testNodeRestart);
TESTCASE("NoLoad", TESTCASE("NoLoad",
...@@ -776,6 +815,11 @@ TESTCASE("Bug15632", ...@@ -776,6 +815,11 @@ TESTCASE("Bug15632",
STEP(runBug15632); STEP(runBug15632);
FINALIZER(runClearTable); FINALIZER(runClearTable);
} }
TESTCASE("Bug15685",
"Test bug with NF during abort"){
STEP(runBug15685);
FINALIZER(runClearTable);
}
NDBT_TESTSUITE_END(testNodeRestart); NDBT_TESTSUITE_END(testNodeRestart);
int main(int argc, const char** argv){ int main(int argc, const char** argv){
......
...@@ -438,6 +438,14 @@ max-time: 500 ...@@ -438,6 +438,14 @@ max-time: 500
cmd: testNodeRestart cmd: testNodeRestart
args: -n Bug15587 T1 args: -n Bug15587 T1
max-time: 500
cmd: testNodeRestart
args: -n Bug15632 T1
max-time: 500
cmd: testNodeRestart
args: -n Bug15685 T1
# OLD FLEX # OLD FLEX
max-time: 500 max-time: 500
cmd: flexBench cmd: flexBench
......
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