Commit 32ec0162 authored by unknown's avatar unknown

ndb - testIndex -n NFNR3


ndb/test/ndbapi/testIndex.cpp:
  Use stop and wait to capture error during restart
ndb/test/src/UtilTransactions.cpp:
  Add extra check for readRowFromIndex failure due to loosing of locks
   in scan
parent d847cab1
...@@ -1277,7 +1277,7 @@ TESTCASE("CreateLoadDrop_O", ...@@ -1277,7 +1277,7 @@ TESTCASE("CreateLoadDrop_O",
TESTCASE("NFNR1", TESTCASE("NFNR1",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
//TC_PROPERTY("Threads", 2); TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(runLoadTable); INITIALIZER(runLoadTable);
...@@ -1292,6 +1292,7 @@ TESTCASE("NFNR1_O", ...@@ -1292,6 +1292,7 @@ TESTCASE("NFNR1_O",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("OrderedIndex", 1); TC_PROPERTY("OrderedIndex", 1);
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(runLoadTable); INITIALIZER(runLoadTable);
...@@ -1305,6 +1306,7 @@ TESTCASE("NFNR1_O", ...@@ -1305,6 +1306,7 @@ TESTCASE("NFNR1_O",
TESTCASE("NFNR2", TESTCASE("NFNR2",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
...@@ -1321,6 +1323,7 @@ TESTCASE("NFNR2_O", ...@@ -1321,6 +1323,7 @@ TESTCASE("NFNR2_O",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("OrderedIndex", 1); TC_PROPERTY("OrderedIndex", 1);
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
...@@ -1336,6 +1339,7 @@ TESTCASE("NFNR2_O", ...@@ -1336,6 +1339,7 @@ TESTCASE("NFNR2_O",
TESTCASE("NFNR3", TESTCASE("NFNR3",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
...@@ -1351,6 +1355,7 @@ TESTCASE("NFNR3_O", ...@@ -1351,6 +1355,7 @@ TESTCASE("NFNR3_O",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("OrderedIndex", 1); TC_PROPERTY("OrderedIndex", 1);
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 2);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
...@@ -1365,6 +1370,7 @@ TESTCASE("NFNR3_O", ...@@ -1365,6 +1370,7 @@ TESTCASE("NFNR3_O",
TESTCASE("NFNR4", TESTCASE("NFNR4",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 4);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
...@@ -1383,6 +1389,7 @@ TESTCASE("NFNR4_O", ...@@ -1383,6 +1389,7 @@ TESTCASE("NFNR4_O",
"Test that indexes are correctly maintained during node fail and node restart"){ "Test that indexes are correctly maintained during node fail and node restart"){
TC_PROPERTY("OrderedIndex", 1); TC_PROPERTY("OrderedIndex", 1);
TC_PROPERTY("LoggedIndexes", (unsigned)0); TC_PROPERTY("LoggedIndexes", (unsigned)0);
TC_PROPERTY("PauseThreads", 4);
INITIALIZER(runClearTable); INITIALIZER(runClearTable);
INITIALIZER(createRandomIndex); INITIALIZER(createRandomIndex);
INITIALIZER(createPkIndex); INITIALIZER(createPkIndex);
......
...@@ -629,7 +629,7 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb, ...@@ -629,7 +629,7 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb,
parallelism = 1; parallelism = 1;
while (true){ while (true){
restart:
if (retryAttempt >= retryMax){ if (retryAttempt >= retryMax){
g_info << "ERROR: has retried this operation " << retryAttempt g_info << "ERROR: has retried this operation " << retryAttempt
<< " times, failing!" << endl; << " times, failing!" << endl;
...@@ -719,11 +719,26 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb, ...@@ -719,11 +719,26 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb,
// ndbout << row.c_str().c_str() << endl; // ndbout << row.c_str().c_str() << endl;
if (readRowFromTableAndIndex(pNdb, if (readRowFromTableAndIndex(pNdb,
pTrans, pTrans,
pIndex, pIndex,
row) != NDBT_OK){ row) != NDBT_OK){
while((eof= pOp->nextResult(false)) == 0);
if(eof == 2)
eof = pOp->nextResult(true); // this should give -1
if(eof == -1)
{
const NdbError err = pTrans->getNdbError();
if (err.status == NdbError::TemporaryError){
ERR(err);
pNdb->closeTransaction(pTrans);
NdbSleep_MilliSleep(50);
retryAttempt++;
goto restart;
}
}
pNdb->closeTransaction(pTrans); pNdb->closeTransaction(pTrans);
return NDBT_FAILED; return NDBT_FAILED;
} }
...@@ -736,7 +751,6 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb, ...@@ -736,7 +751,6 @@ UtilTransactions::scanAndCompareUniqueIndex(Ndb* pNdb,
pNdb->closeTransaction(pTrans); pNdb->closeTransaction(pTrans);
NdbSleep_MilliSleep(50); NdbSleep_MilliSleep(50);
retryAttempt++; retryAttempt++;
rows--;
continue; continue;
} }
ERR(err); ERR(err);
...@@ -811,7 +825,6 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb, ...@@ -811,7 +825,6 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
check = pOp->readTuple(); check = pOp->readTuple();
if( check == -1 ) { if( check == -1 ) {
ERR(pTrans1->getNdbError()); ERR(pTrans1->getNdbError());
pNdb->closeTransaction(pTrans1);
goto close_all; goto close_all;
} }
...@@ -943,7 +956,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb, ...@@ -943,7 +956,7 @@ UtilTransactions::readRowFromTableAndIndex(Ndb* pNdb,
#if VERBOSE #if VERBOSE
printf("\n"); printf("\n");
#endif #endif
scanTrans->refresh();
check = pTrans1->execute(Commit); check = pTrans1->execute(Commit);
if( check == -1 ) { if( check == -1 ) {
const NdbError err = pTrans1->getNdbError(); const NdbError err = pTrans1->getNdbError();
......
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