summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorunknown <tomas@whalegate.ndb.mysql.com>2007-04-12 19:49:21 +0200
committerunknown <tomas@whalegate.ndb.mysql.com>2007-04-12 19:49:21 +0200
commit70d753c67a34a059a8862070419be53fd1eb0283 (patch)
tree3b6621b3de803f8bce964749aac2cedc27020574 /ndb
parentaa051961c9ac4629fd7dca9f236172e47660bbeb (diff)
parentcf31f9a89933bfe010327cfb8a0959dde23dd32b (diff)
downloadmariadb-git-70d753c67a34a059a8862070419be53fd1eb0283.tar.gz
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-4.1-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-4.1-opt
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/kernel/blocks/ERROR_codes.txt7
-rw-r--r--ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp22
-rw-r--r--ndb/src/kernel/blocks/dbtc/DbtcMain.cpp38
-rw-r--r--ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp6
-rw-r--r--ndb/test/ndbapi/testScan.cpp41
-rw-r--r--ndb/test/run-test/daily-basic-tests.txt4
6 files changed, 102 insertions, 16 deletions
diff --git a/ndb/src/kernel/blocks/ERROR_codes.txt b/ndb/src/kernel/blocks/ERROR_codes.txt
index 874c128a56d..a1472cf8376 100644
--- a/ndb/src/kernel/blocks/ERROR_codes.txt
+++ b/ndb/src/kernel/blocks/ERROR_codes.txt
@@ -6,7 +6,7 @@ Next DBTUP 4014
Next DBLQH 5043
Next DBDICT 6006
Next DBDIH 7178
-Next DBTC 8038
+Next DBTC 8039
Next CMVMI 9000
Next BACKUP 10022
Next DBUTIL 11002
@@ -285,6 +285,11 @@ ABORT OF TCKEYREQ
8037 : Invalid schema version in TCINDXREQ
+------
+
+8038 : Simulate API disconnect just after SCAN_TAB_REQ
+
+
CMVMI
-----
9000 Set RestartOnErrorInsert to restart -n
diff --git a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
index f9290a75afb..6519444c364 100644
--- a/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
+++ b/ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp
@@ -311,6 +311,16 @@ void Cmvmi::execSTTOR(Signal* signal)
jamEntry();
if (theStartPhase == 1){
jam();
+
+ if(theConfig.lockPagesInMainMemory())
+ {
+ int res = NdbMem_MemLockAll();
+ if(res != 0){
+ g_eventLogger.warning("Failed to memlock pages");
+ warningEvent("Failed to memlock pages");
+ }
+ }
+
sendSTTORRY(signal);
return;
} else if (theStartPhase == 3) {
@@ -331,18 +341,6 @@ void Cmvmi::execSTTOR(Signal* signal)
execOPEN_COMREQ(signal);
globalData.theStartLevel = NodeState::SL_STARTED;
sendSTTORRY(signal);
- } else {
- jam();
-
- if(theConfig.lockPagesInMainMemory()){
- int res = NdbMem_MemLockAll();
- if(res != 0){
- g_eventLogger.warning("Failed to memlock pages");
- warningEvent("Failed to memlock pages");
- }
- }
-
- sendSTTORRY(signal);
}
}
diff --git a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
index 59e6bd35baf..cdab0635dce 100644
--- a/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
+++ b/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
@@ -8619,6 +8619,20 @@ void Dbtc::execSCAN_TABREQ(Signal* signal)
* IF ANY TO RECEIVE.
**********************************************************/
scanptr.p->scanState = ScanRecord::WAIT_AI;
+
+ if (ERROR_INSERTED(8038))
+ {
+ /**
+ * Force API_FAILREQ
+ */
+ DisconnectRep * const rep = (DisconnectRep *)signal->getDataPtrSend();
+ rep->nodeId = refToNode(apiConnectptr.p->ndbapiBlockref);
+ rep->err = 8038;
+
+ EXECUTE_DIRECT(CMVMI, GSN_DISCONNECT_REP, signal, 2);
+ CLEAR_ERROR_INSERT_VALUE;
+ }
+
return;
SCAN_error_check:
@@ -8706,6 +8720,7 @@ void Dbtc::initScanrec(ScanRecordPtr scanptr,
jam();
ScanFragRecPtr ptr;
ndbrequire(list.seize(ptr));
+ ptr.p->scanFragState = ScanFragRec::IDLE;
ptr.p->scanRec = scanptr.i;
ptr.p->scanFragId = 0;
ptr.p->m_apiPtr = cdata[i];
@@ -9457,9 +9472,17 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanRecord* scanP = scanPtr.p;
ndbrequire(scanPtr.p->scanState != ScanRecord::IDLE);
+ ScanRecord::ScanState old = scanPtr.p->scanState;
scanPtr.p->scanState = ScanRecord::CLOSING_SCAN;
scanPtr.p->m_close_scan_req = req_received;
+ if (old == ScanRecord::WAIT_FRAGMENT_COUNT)
+ {
+ jam();
+ scanPtr.p->scanState = old;
+ return; // Will continue on execDI_FCOUNTCONF
+ }
+
/**
* Queue : Action
* ============= : =================
@@ -9487,11 +9510,22 @@ Dbtc::close_scan_req(Signal* signal, ScanRecordPtr scanPtr, bool req_received){
ScanFragRecPtr curr = ptr; // Remove while iterating...
running.next(ptr);
- if(curr.p->scanFragState == ScanFragRec::WAIT_GET_PRIMCONF){
+ switch(curr.p->scanFragState){
+ case ScanFragRec::IDLE:
+ jam(); // real early abort
+ ndbrequire(old == ScanRecord::WAIT_AI);
+ running.release(curr);
+ continue;
+ case ScanFragRec::WAIT_GET_PRIMCONF:
jam();
continue;
+ case ScanFragRec::LQH_ACTIVE:
+ jam();
+ break;
+ default:
+ jamLine(curr.p->scanFragState);
+ ndbrequire(false);
}
- ndbrequire(curr.p->scanFragState == ScanFragRec::LQH_ACTIVE);
curr.p->startFragTimer(ctcTimer);
curr.p->scanFragState = ScanFragRec::LQH_ACTIVE;
diff --git a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
index e16d3df6d8d..37bf33f0313 100644
--- a/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
+++ b/ndb/src/kernel/blocks/dbtup/DbtupCommit.cpp
@@ -390,6 +390,7 @@ Dbtup::commitRecord(Signal* signal,
fragptr.p = regFragPtr;
tabptr.p = regTabPtr;
+ Uint32 hashValue = firstOpPtr.p->hashValue;
if (opType == ZINSERT_DELETE) {
ljam();
@@ -412,6 +413,7 @@ Dbtup::commitRecord(Signal* signal,
//--------------------------------------------------------------------
Uint32 saveOpType = regOperPtr->optype;
regOperPtr->optype = ZINSERT;
+ regOperPtr->hashValue = hashValue;
operPtr.p = regOperPtr;
checkDetachedTriggers(signal,
@@ -444,6 +446,8 @@ Dbtup::commitRecord(Signal* signal,
befOpPtr.p->changeMask.clear();
befOpPtr.p->changeMask.bitOR(attributeMask);
befOpPtr.p->gci = regOperPtr->gci;
+ befOpPtr.p->optype = ZUPDATE;
+ befOpPtr.p->hashValue = hashValue;
befOpPtr.p->optype = opType;
operPtr.p = befOpPtr.p;
@@ -478,11 +482,13 @@ Dbtup::commitRecord(Signal* signal,
Uint32 fragPageId = befOpPtr.p->fragPageId;
Uint32 pageIndex = befOpPtr.p->pageIndex;
+ befOpPtr.p->optype = ZDELETE;
befOpPtr.p->realPageId = befOpPtr.p->realPageIdC;
befOpPtr.p->pageOffset = befOpPtr.p->pageOffsetC;
befOpPtr.p->fragPageId = befOpPtr.p->fragPageIdC;
befOpPtr.p->pageIndex = befOpPtr.p->pageIndexC;
befOpPtr.p->gci = regOperPtr->gci;
+ befOpPtr.p->hashValue = hashValue;
befOpPtr.p->optype = opType;
operPtr.p = befOpPtr.p;
diff --git a/ndb/test/ndbapi/testScan.cpp b/ndb/test/ndbapi/testScan.cpp
index f1018d29846..e228c9c0bd1 100644
--- a/ndb/test/ndbapi/testScan.cpp
+++ b/ndb/test/ndbapi/testScan.cpp
@@ -622,7 +622,7 @@ int runRestarter(NDBT_Context* ctx, NDBT_Step* step){
int nodeId = restarter.getDbNodeId(lastId);
lastId = (lastId + 1) % restarter.getNumDbNodes();
- if(restarter.restartOneDbNode(nodeId) != 0){
+ if(restarter.restartOneDbNode(nodeId, false, false, true) != 0){
g_err << "Failed to restartNextDbNode" << endl;
result = NDBT_FAILED;
break;
@@ -1080,6 +1080,39 @@ int runScanRestart(NDBT_Context* ctx, NDBT_Step* step){
}
+int
+runBug24447(NDBT_Context* ctx, NDBT_Step* step){
+ int loops = 1; //ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ int abort = ctx->getProperty("AbortProb", 15);
+ NdbRestarter restarter;
+ HugoTransactions hugoTrans(*ctx->getTab());
+ int i = 0;
+ while (i<loops && !ctx->isTestStopped())
+ {
+ g_info << i++ << ": ";
+
+ int nodeId = restarter.getRandomNotMasterNodeId(rand());
+ if (nodeId == -1)
+ nodeId = restarter.getMasterNodeId();
+ if (restarter.insertErrorInNode(nodeId, 8038) != 0)
+ {
+ ndbout << "Could not insert error in node="<<nodeId<<endl;
+ return NDBT_FAILED;
+ }
+
+ for (Uint32 j = 0; i<10; i++)
+ {
+ hugoTrans.scanReadRecords(GETNDB(step), records, abort, 0,
+ NdbOperation::LM_CommittedRead);
+ }
+
+ }
+ restarter.insertErrorInAllNodes(0);
+
+ return NDBT_OK;
+}
+
NDBT_TESTSUITE(testScan);
TESTCASE("ScanRead",
"Verify scan requirement: It should be possible "\
@@ -1540,6 +1573,12 @@ TESTCASE("ScanRestart",
STEP(runScanRestart);
FINALIZER(runClearTable);
}
+TESTCASE("Bug24447",
+ ""){
+ INITIALIZER(runLoadTable);
+ STEP(runBug24447);
+ FINALIZER(runClearTable);
+}
NDBT_TESTSUITE_END(testScan);
int main(int argc, const char** argv){
diff --git a/ndb/test/run-test/daily-basic-tests.txt b/ndb/test/run-test/daily-basic-tests.txt
index 39782ecbbc7..51ee6d14f00 100644
--- a/ndb/test/run-test/daily-basic-tests.txt
+++ b/ndb/test/run-test/daily-basic-tests.txt
@@ -439,6 +439,10 @@ cmd: testScan
args: -l 100 -n Scan-bug8262 T7
max-time: 500
+cmd: testScan
+args: -n Bug24447 T1
+
+max-time: 500
cmd: testNodeRestart
args: -n Bug15587 T1