Commit c95ef332 authored by joreland@mysql.com's avatar joreland@mysql.com

Bug fix for testBasic -n MassiveRollback, a bug in LCP in LQH

parent 2e95d812
...@@ -410,7 +410,6 @@ ...@@ -410,7 +410,6 @@
*/ */
class Dblqh: public SimulatedBlock { class Dblqh: public SimulatedBlock {
public: public:
enum LcpCloseState { enum LcpCloseState {
LCP_IDLE = 0, LCP_IDLE = 0,
LCP_RUNNING = 1, // LCP is running LCP_RUNNING = 1, // LCP is running
...@@ -1990,7 +1989,6 @@ public: ...@@ -1990,7 +1989,6 @@ public:
UintR nextTcLogQueue; UintR nextTcLogQueue;
UintR nextTc; UintR nextTc;
UintR nextTcConnectrec; UintR nextTcConnectrec;
Uint16 nodeAfterNext[2];
UintR prevHashRec; UintR prevHashRec;
UintR prevLogTcrec; UintR prevLogTcrec;
UintR prevTc; UintR prevTc;
...@@ -2027,6 +2025,7 @@ public: ...@@ -2027,6 +2025,7 @@ public:
Uint16 nextReplica; Uint16 nextReplica;
Uint16 primKeyLen; Uint16 primKeyLen;
Uint16 save1; Uint16 save1;
Uint16 nodeAfterNext[3];
Uint8 activeCreat; Uint8 activeCreat;
Uint8 apiVersionNo; Uint8 apiVersionNo;
......
This diff is collapsed.
...@@ -350,16 +350,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -350,16 +350,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
return; return;
} }
case GSN_TRANSID_AI: case GSN_TRANSID_AI:{
{
tFirstDataPtr = int2void(tFirstData); tFirstDataPtr = int2void(tFirstData);
assert(tFirstDataPtr); NdbReceiver* tRec;
if (tFirstDataPtr == 0) goto InvalidSignal; if (tFirstDataPtr && (tRec = void2rec(tFirstDataPtr)) &&
NdbReceiver* tRec = void2rec(tFirstDataPtr); tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) &&
assert(tRec->checkMagicNumber());
assert(tRec->getTransaction());
assert(tRec->getTransaction()->checkState_TransId(((const TransIdAI*)tDataPtr)->transId));
if(tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) &&
tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){ tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){
Uint32 com; Uint32 com;
if(aSignal->m_noOfSections > 0){ if(aSignal->m_noOfSections > 0){
...@@ -380,7 +375,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -380,7 +375,7 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
break; break;
case NdbReceiver::NDB_SCANRECEIVER: case NdbReceiver::NDB_SCANRECEIVER:
tCon->theScanningOp->receiver_delivered(tRec); tCon->theScanningOp->receiver_delivered(tRec);
theWaiter.m_state = (tWaitState == WAIT_SCAN? NO_WAIT: tWaitState); theWaiter.m_state = (tWaitState == WAIT_SCAN ? NO_WAIT : tWaitState);
break; break;
default: default:
goto InvalidSignal; goto InvalidSignal;
...@@ -388,7 +383,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -388,7 +383,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
} }
break; break;
} else { } else {
goto InvalidSignal; /**
* This is ok as transaction can have been aborted before TRANSID_AI
* arrives (if TUP on other node than TC)
*/
return;
} }
} }
case GSN_TCKEY_FAILCONF: case GSN_TCKEY_FAILCONF:
...@@ -695,7 +694,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -695,7 +694,8 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
(tCon = void2con(tFirstDataPtr)) && (tCon->checkMagicNumber() == 0)){ (tCon = void2con(tFirstDataPtr)) && (tCon->checkMagicNumber() == 0)){
if(aSignal->m_noOfSections > 0){ if(aSignal->m_noOfSections > 0){
tReturnCode = tCon->receiveSCAN_TABCONF(aSignal, ptr[0].p, ptr[0].sz); tReturnCode = tCon->receiveSCAN_TABCONF(aSignal,
ptr[0].p, ptr[0].sz);
} else { } else {
tReturnCode = tReturnCode =
tCon->receiveSCAN_TABCONF(aSignal, tCon->receiveSCAN_TABCONF(aSignal,
...@@ -730,10 +730,9 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -730,10 +730,9 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
} }
case GSN_KEYINFO20: { case GSN_KEYINFO20: {
tFirstDataPtr = int2void(tFirstData); tFirstDataPtr = int2void(tFirstData);
if (tFirstDataPtr == 0) goto InvalidSignal; NdbReceiver* tRec;
NdbReceiver* tRec = void2rec(tFirstDataPtr); if (tFirstDataPtr && (tRec = void2rec(tFirstDataPtr)) &&
tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) &&
if(tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) &&
tCon->checkState_TransId(&((const KeyInfo20*)tDataPtr)->transId1)){ tCon->checkState_TransId(&((const KeyInfo20*)tDataPtr)->transId1)){
Uint32 len = ((const KeyInfo20*)tDataPtr)->keyLen; Uint32 len = ((const KeyInfo20*)tDataPtr)->keyLen;
...@@ -756,8 +755,13 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -756,8 +755,13 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
goto InvalidSignal; goto InvalidSignal;
} }
break; break;
} else {
/**
* This is ok as transaction can have been aborted before KEYINFO20
* arrives (if TUP on other node than TC)
*/
return;
} }
goto InvalidSignal;
} }
case GSN_TCINDXCONF:{ case GSN_TCINDXCONF:{
tFirstDataPtr = int2void(tFirstData); tFirstDataPtr = int2void(tFirstData);
......
...@@ -962,6 +962,7 @@ int runMassiveRollback(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -962,6 +962,7 @@ int runMassiveRollback(NDBT_Context* ctx, NDBT_Step* step){
const Uint32 OPS_TOTAL = 4096; const Uint32 OPS_TOTAL = 4096;
for(int row = 0; row < records; row++){ for(int row = 0; row < records; row++){
int res;
CHECK(hugoOps.startTransaction(pNdb) == 0); CHECK(hugoOps.startTransaction(pNdb) == 0);
for(int i = 0; i<OPS_TOTAL; i += OPS_PER_TRANS){ for(int i = 0; i<OPS_TOTAL; i += OPS_PER_TRANS){
for(int j = 0; j<OPS_PER_TRANS; j++){ for(int j = 0; j<OPS_PER_TRANS; j++){
...@@ -972,7 +973,12 @@ int runMassiveRollback(NDBT_Context* ctx, NDBT_Step* step){ ...@@ -972,7 +973,12 @@ int runMassiveRollback(NDBT_Context* ctx, NDBT_Step* step){
if(result != NDBT_OK){ if(result != NDBT_OK){
break; break;
} }
CHECK(hugoOps.execute_NoCommit(pNdb) == 0); res = hugoOps.execute_NoCommit(pNdb);
if(res != 0){
NdbError err = pNdb->getNdbError(res);
CHECK(err.classification == NdbError::TimeoutExpired);
break;
}
} }
if(result != NDBT_OK){ if(result != NDBT_OK){
break; break;
......
...@@ -1364,7 +1364,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb, ...@@ -1364,7 +1364,7 @@ HugoTransactions::pkUpdateRecords(Ndb* pNdb,
allocRows(batch); allocRows(batch);
g_info << "|- Updating records..." << endl; g_info << "|- Updating records (batch=" << batch << ")..." << endl;
while (r < records){ while (r < records){
if (retryAttempt >= retryMax){ if (retryAttempt >= retryMax){
......
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