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