Commit abb1963d authored by unknown's avatar unknown

ndb - fix abort of scan when in WAIT_AI_SCAN state


ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Make sure to release all resources when aborting scan
    in state WAIT_AI_SCAN
parent e4dbc32f
...@@ -7320,6 +7320,8 @@ void Dblqh::closeScanRequestLab(Signal* signal) ...@@ -7320,6 +7320,8 @@ void Dblqh::closeScanRequestLab(Signal* signal)
scanptr.p->m_curr_batch_size_rows = 0; scanptr.p->m_curr_batch_size_rows = 0;
scanptr.p->m_curr_batch_size_bytes= 0; scanptr.p->m_curr_batch_size_bytes= 0;
sendScanFragConf(signal, ZTRUE); sendScanFragConf(signal, ZTRUE);
abort_scan(signal, scanptr.i, 0);
return;
break; break;
case TcConnectionrec::SCAN_TUPKEY: case TcConnectionrec::SCAN_TUPKEY:
case TcConnectionrec::SCAN_FIRST_STOPPED: case TcConnectionrec::SCAN_FIRST_STOPPED:
...@@ -7711,6 +7713,9 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){ ...@@ -7711,6 +7713,9 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){
tcConnectptr.p->transactionState = TcConnectionrec::IDLE; tcConnectptr.p->transactionState = TcConnectionrec::IDLE;
tcConnectptr.p->abortState = TcConnectionrec::ABORT_ACTIVE; tcConnectptr.p->abortState = TcConnectionrec::ABORT_ACTIVE;
if(errcode)
{
jam();
ScanFragRef * ref = (ScanFragRef*)&signal->theData[0]; ScanFragRef * ref = (ScanFragRef*)&signal->theData[0];
ref->senderData = tcConnectptr.p->clientConnectrec; ref->senderData = tcConnectptr.p->clientConnectrec;
ref->transId1 = tcConnectptr.p->transid[0]; ref->transId1 = tcConnectptr.p->transid[0];
...@@ -7718,6 +7723,7 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){ ...@@ -7718,6 +7723,7 @@ void Dblqh::abort_scan(Signal* signal, Uint32 scan_ptr_i, Uint32 errcode){
ref->errorCode = errcode; ref->errorCode = errcode;
sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal, sendSignal(tcConnectptr.p->clientBlockref, GSN_SCAN_FRAGREF, signal,
ScanFragRef::SignalLength, JBB); ScanFragRef::SignalLength, JBB);
}
deleteTransidHash(signal); deleteTransidHash(signal);
releaseOprec(signal); releaseOprec(signal);
releaseTcrec(signal, tcConnectptr); releaseTcrec(signal, tcConnectptr);
......
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