Below is the list of changes that have just been committed into a local
5.1 repository of jonas. When jonas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-10-10 10:48:08+02:00, jonas@stripped +2 -0
ndb - bug#23107
fix bug in handling of inactive timeout for scan, when all is delivered
recommit in mysql-5.1-wl2325-5.0
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp@stripped, 2006-10-10 10:48:07+02:00,
jonas@stripped +23 -0
1) set timeout if all scans are at api
2) Use c_appl_timeout_value when getting scan timeout
storage/ndb/test/ndbapi/testTimeout.cpp@stripped, 2006-10-10 10:48:07+02:00,
jonas@stripped +49 -1
test prg
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: jonas
# Host: perch.ndb.mysql.com
# Root: /home/jonas/src/mysql-5.1-wl2325-5.0
--- 1.100/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2006-10-10 10:48:12 +02:00
+++ 1.101/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2006-10-10 10:48:12 +02:00
@@ -6330,6 +6330,18 @@
break;
case CS_START_SCAN:{
jam();
+
+ /*
+ We are waiting for application to continue the transaction. In this
+ particular state we will use the application timeout parameter rather
+ than the shorter Deadlock detection timeout.
+ */
+ if (c_appl_timeout_value == 0 ||
+ (ctcTimer - getApiConTimer(apiConnectptr.i)) <= c_appl_timeout_value) {
+ jam();
+ return;
+ }//if
+
ScanRecordPtr scanPtr;
scanPtr.i = apiConnectptr.p->apiScanRec;
ptrCheckGuard(scanPtr, cscanrecFileSize, scanRecord);
@@ -9846,6 +9858,17 @@
{
conf->requestInfo = op_count | ScanTabConf::EndOfData;
releaseScanResources(scanPtr);
+ }
+ else
+ {
+ if (scanPtr.p->m_running_scan_frags.isEmpty())
+ {
+ jam();
+ /**
+ * All scan frags delivered...waiting for API
+ */
+ setApiConTimer(apiConnectptr.i, ctcTimer, __LINE__);
+ }
}
if(4 + 3 * op_count > 25){
--- 1.14/storage/ndb/test/ndbapi/testTimeout.cpp 2006-10-10 10:48:12 +02:00
+++ 1.15/storage/ndb/test/ndbapi/testTimeout.cpp 2006-10-10 10:48:12 +02:00
@@ -388,6 +388,45 @@
return result;
}
+int runBuddyTransTimeout(NDBT_Context* ctx, NDBT_Step* step){
+ int result = NDBT_OK;
+ int loops = ctx->getNumLoops();
+ int records = ctx->getNumRecords();
+ int stepNo = step->getStepNo();
+ ndbout << "TransactionInactiveTimeout="<< TIMEOUT <<endl;
+
+ HugoOperations hugoOps(*ctx->getTab());
+ Ndb* pNdb = GETNDB(step);
+
+ for (int l = 1; l < loops && result == NDBT_OK; l++){
+
+ NdbTransaction* pTrans = 0;
+ do{
+ pTrans = pNdb->startTransaction();
+ NdbScanOperation* pOp = pTrans->getNdbScanOperation(ctx->getTab());
+ CHECK(pOp->readTuples(NdbOperation::LM_Read, 0, 0, 1) == 0);
+ CHECK(pTrans->execute(NoCommit) == 0);
+
+ int sleep = 2 * TIMEOUT;
+ ndbout << "Sleeping for " << sleep << " milliseconds" <<
endl;
+ NdbSleep_MilliSleep(sleep);
+
+ int res = 0;
+ while((res = pOp->nextResult()) == 0);
+ ndbout_c("res: %d", res);
+ CHECK(res == -1);
+
+ } while(false);
+
+ if (pTrans)
+ {
+ pTrans->close();
+ }
+ }
+
+ return result;
+}
+
int
runError4012(NDBT_Context* ctx, NDBT_Step* step){
int result = NDBT_OK;
@@ -495,6 +534,15 @@
FINALIZER(resetTransactionTimeout);
FINALIZER(runClearTable);
}
+TESTCASE("BuddyTransTimeout1",
+ "Start a scan and check that it gets aborted"){
+ INITIALIZER(runLoadTable);
+ INITIALIZER(setTransactionTimeout);
+ STEPS(runBuddyTransTimeout, 1);
+ FINALIZER(resetTransactionTimeout);
+ FINALIZER(runClearTable);
+}
+#if 0
TESTCASE("Error4012", ""){
TC_PROPERTY("TransactionDeadlockTimeout", 120000);
INITIALIZER(runLoadTable);
@@ -503,7 +551,7 @@
STEPS(runError4012, 2);
FINALIZER(runClearTable);
}
-
+#endif
NDBT_TESTSUITE_END(testTimeout);
int main(int argc, const char** argv){
| Thread |
|---|
| • bk commit into 5.1 tree (jonas:1.2059) BUG#23107 | jonas | 10 Oct |