Commit 997f6350 authored by unknown's avatar unknown

ndb - bug#25286

  - add some sanity check to marker/hash code to see that element isnt inserted twice into hashtable
    (if defined VM_TRACE or ERROR_INSERT)

  - allow REMOVE_MARKER_ORD to fail(dont find record) in release


storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  add a bunch of sanity check ifdef#vmtrace of #error_insert
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  add a bunch of sanity check ifdef#vmtrace of #error_insert
parent 734a3036
......@@ -2480,8 +2480,16 @@ Dblqh::execREMOVE_MARKER_ORD(Signal* signal)
CommitAckMarkerPtr removedPtr;
m_commitAckMarkerHash.remove(removedPtr, key);
#if defined VM_TRACE || defined ERROR_INSERT
ndbrequire(removedPtr.i != RNIL);
m_commitAckMarkerPool.release(removedPtr);
#else
if (removedPtr.i != RNIL)
{
jam();
m_commitAckMarkerPool.release(removedPtr);
}
#endif
#ifdef MARKER_TRACE
ndbout_c("Rem marker[%.8x %.8x]", key.transid1, key.transid2);
#endif
......@@ -3406,7 +3414,7 @@ void Dblqh::execLQHKEYREQ(Signal* signal)
markerPtr.p->tcNodeId = tcNodeId;
CommitAckMarkerPtr tmp;
#ifdef VM_TRACE
#if defined VM_TRACE || defined ERROR_INSERT
#ifdef MARKER_TRACE
ndbout_c("Add marker[%.8x %.8x]", markerPtr.p->transid1, markerPtr.p->transid2);
#endif
......@@ -9630,7 +9638,7 @@ Uint32 Dblqh::initScanrec(const ScanFragReq* scanFragReq)
active.add(scanptr);
if(scanptr.p->scanKeyinfoFlag){
jam();
#ifdef VM_TRACE
#if defined VM_TRACE || defined ERROR_INSERT
ScanRecordPtr tmp;
ndbrequire(!c_scanTakeOverHash.find(tmp, * scanptr.p));
#endif
......@@ -9754,7 +9762,7 @@ void Dblqh::finishScanrec(Signal* signal)
scans.add(restart);
if(restart.p->scanKeyinfoFlag){
jam();
#ifdef VM_TRACE
#if defined VM_TRACE || defined ERROR_INSERT
ScanRecordPtr tmp;
ndbrequire(!c_scanTakeOverHash.find(tmp, * restart.p));
#endif
......
......@@ -2825,6 +2825,12 @@ void Dbtc::execTCKEYREQ(Signal* signal)
tmp.p->apiNodeId = refToNode(regApiPtr->ndbapiBlockref);
tmp.p->apiConnectPtr = TapiIndex;
tmp.p->noOfLqhs = 0;
#if defined VM_TRACE || defined ERROR_INSERT
{
CommitAckMarkerPtr check;
ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
}
#endif
m_commitAckMarkerHash.add(tmp);
}
}
......@@ -8115,6 +8121,13 @@ void Dbtc::initApiConnectFail(Signal* signal)
tmp.p->noOfLqhs = 1;
tmp.p->lqhNodeId[0] = tnodeid;
tmp.p->apiConnectPtr = apiConnectptr.i;
#if defined VM_TRACE || defined ERROR_INSERT
{
CommitAckMarkerPtr check;
ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
}
#endif
m_commitAckMarkerHash.add(tmp);
}
}//Dbtc::initApiConnectFail()
......@@ -8271,6 +8284,12 @@ void Dbtc::updateApiStateFail(Signal* signal)
tmp.p->noOfLqhs = 1;
tmp.p->lqhNodeId[0] = tnodeid;
tmp.p->apiConnectPtr = apiConnectptr.i;
#if defined VM_TRACE || defined ERROR_INSERT
{
CommitAckMarkerPtr check;
ndbrequire(!m_commitAckMarkerHash.find(check, *tmp.p));
}
#endif
m_commitAckMarkerHash.add(tmp);
} else {
jam();
......
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