Commit 75bd09a6 authored by unknown's avatar unknown

ndb - bug#20185

  Fix race in testprg...causing random TC crashes


storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  remove incorrect work-around
storage/ndb/test/ndbapi/testNodeRestart.cpp:
  Fix race in testprg...causing random TC crashes
parent fbb955d7
...@@ -7099,21 +7099,16 @@ Dbtc::nodeFailCheckTransactions(Signal* signal, ...@@ -7099,21 +7099,16 @@ Dbtc::nodeFailCheckTransactions(Signal* signal,
for (transPtr.i = transPtrI; transPtr.i < capiConnectFilesize; transPtr.i++) for (transPtr.i = transPtrI; transPtr.i < capiConnectFilesize; transPtr.i++)
{ {
ptrCheckGuard(transPtr, capiConnectFilesize, apiConnectRecord); ptrCheckGuard(transPtr, capiConnectFilesize, apiConnectRecord);
Uint32 state = transPtr.p->apiConnectstate;
if (transPtr.p->m_transaction_nodes.get(failedNodeId)) if (transPtr.p->m_transaction_nodes.get(failedNodeId))
{ {
jam(); jam();
// avoid assertion in timeoutfoundlab
if (state != CS_PREPARE_TO_COMMIT)
{
// Force timeout regardless of state // Force timeout regardless of state
c_appl_timeout_value = 1; c_appl_timeout_value = 1;
setApiConTimer(transPtr.i, TtcTimer - 2, __LINE__); setApiConTimer(transPtr.i, TtcTimer - 2, __LINE__);
timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT); timeOutFoundLab(signal, transPtr.i, ZNODEFAIL_BEFORE_COMMIT);
c_appl_timeout_value = TapplTimeout; c_appl_timeout_value = TapplTimeout;
} }
}
// Send CONTINUEB to continue later // Send CONTINUEB to continue later
signal->theData[0] = TcContinueB::ZNF_CHECK_TRANSACTIONS; signal->theData[0] = TcContinueB::ZNF_CHECK_TRANSACTIONS;
......
...@@ -887,6 +887,9 @@ int runBug20185(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -887,6 +887,9 @@ int runBug20185(NDBT_Context* ctx, NDBT_Step* step){
return NDBT_FAILED; return NDBT_FAILED;
NdbSleep_MilliSleep(3000); NdbSleep_MilliSleep(3000);
Vector<int> nodes;
for (Uint32 i = 0; i<restarter.getNumDbNodes(); i++)
nodes.push_back(restarter.getDbNodeId(i));
retry: retry:
if(hugoOps.startTransaction(pNdb) != 0) if(hugoOps.startTransaction(pNdb) != 0)
...@@ -910,11 +913,16 @@ int runBug20185(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -910,11 +913,16 @@ int runBug20185(NDBT_Context* ctx, NDBT_Step* step){
nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes()); nodeId = restarter.getDbNodeId(rand() % restarter.getNumDbNodes());
} while (nodeId == node); } while (nodeId == node);
if (restarter.insertErrorInAllNodes(7030)) ndbout_c("7031 to %d", nodeId);
if (restarter.insertErrorInNode(nodeId, 7031))
return NDBT_FAILED; return NDBT_FAILED;
if (restarter.insertErrorInNode(nodeId, 7031)) for (Uint32 i = 0; i<nodes.size(); i++)
{
if (nodes[i] != nodeId)
if (restarter.insertErrorInNode(nodes[i], 7030))
return NDBT_FAILED; return NDBT_FAILED;
}
NdbSleep_MilliSleep(500); NdbSleep_MilliSleep(500);
......
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