Commit 01f1d5e2 authored by unknown's avatar unknown

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


ndb/src/kernel/blocks/dblqh/Dblqh.hpp:
  max 4 replicas -> 3 next nodes
ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  1) If abort while in fragwaitqueue - just abort
  2) Fix for ACC_LCPSTARTED arrives after one ACC_LCPCONF has arrived
ndb/src/ndbapi/Ndbif.cpp:
  Be more "forgiving" in debug mode
ndb/test/ndbapi/testBasic.cpp:
  Accept timeouts in MassiveTimeout
ndb/test/src/HugoTransactions.cpp:
  Print batch size
parent cbc7e8c7
...@@ -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,47 +350,46 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -350,47 +350,46 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3])
return; return;
} }
case GSN_TRANSID_AI: case GSN_TRANSID_AI:{
{ tFirstDataPtr = int2void(tFirstData);
tFirstDataPtr = int2void(tFirstData); NdbReceiver* tRec;
assert(tFirstDataPtr); if (tFirstDataPtr && (tRec = void2rec(tFirstDataPtr)) &&
if (tFirstDataPtr == 0) goto InvalidSignal; tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) &&
NdbReceiver* tRec = void2rec(tFirstDataPtr); tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){
assert(tRec->checkMagicNumber()); Uint32 com;
assert(tRec->getTransaction()); if(aSignal->m_noOfSections > 0){
assert(tRec->getTransaction()->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)); com = tRec->execTRANSID_AI(ptr[0].p, ptr[0].sz);
if(tRec->checkMagicNumber() && (tCon = tRec->getTransaction()) && } else {
tCon->checkState_TransId(((const TransIdAI*)tDataPtr)->transId)){ com = tRec->execTRANSID_AI(tDataPtr + TransIdAI::HeaderLength,
Uint32 com; tLen - TransIdAI::HeaderLength);
if(aSignal->m_noOfSections > 0){ }
com = tRec->execTRANSID_AI(ptr[0].p, ptr[0].sz);
} else { if(com == 1){
com = tRec->execTRANSID_AI(tDataPtr + TransIdAI::HeaderLength, switch(tRec->getType()){
tLen - TransIdAI::HeaderLength); case NdbReceiver::NDB_OPERATION:
} case NdbReceiver::NDB_INDEX_OPERATION:
if(tCon->OpCompleteSuccess() != -1){
if(com == 1){ completedTransaction(tCon);
switch(tRec->getType()){ return;
case NdbReceiver::NDB_OPERATION:
case NdbReceiver::NDB_INDEX_OPERATION:
if(tCon->OpCompleteSuccess() != -1){
completedTransaction(tCon);
return;
}
break;
case NdbReceiver::NDB_SCANRECEIVER:
tCon->theScanningOp->receiver_delivered(tRec);
theWaiter.m_state = (tWaitState == WAIT_SCAN? NO_WAIT: tWaitState);
break;
default:
goto InvalidSignal;
} }
break;
case NdbReceiver::NDB_SCANRECEIVER:
tCon->theScanningOp->receiver_delivered(tRec);
theWaiter.m_state = (tWaitState == WAIT_SCAN ? NO_WAIT : tWaitState);
break;
default:
goto InvalidSignal;
} }
break;
} else {
goto InvalidSignal;
} }
break;
} else {
/**
* 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:
{ {
tFirstDataPtr = int2void(tFirstData); tFirstDataPtr = int2void(tFirstData);
...@@ -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,12 +730,11 @@ Ndb::handleReceivedSignal(NdbApiSignal* aSignal, LinearSectionPtr ptr[3]) ...@@ -730,12 +730,11 @@ 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;
Uint32 info = ((const KeyInfo20*)tDataPtr)->scanInfo_Node; Uint32 info = ((const KeyInfo20*)tDataPtr)->scanInfo_Node;
int com = -1; int com = -1;
...@@ -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