From: Date: June 13 2005 7:45pm Subject: bk commit into 4.1 tree (tulin:1.2291) BUG#11290 List-Archive: http://lists.mysql.com/internals/25942 X-Bug: 11290 Message-Id: <200506131745.j5DHjJ19002500@dl145c.mysql.com> Below is the list of changes that have just been committed into a local 4.1 repository of ndbdev. When ndbdev 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 1.2291 05/06/13 19:45:15 tulin@stripped +3 -0 logging_ok: Logging to logging@stripped accepted DbtcMain.cpp, testTimeout.cpp: Bug #11290 TransactionInactiveTimeout = 0 does not result in infinite timeout BitKeeper/etc/logging_ok 1.399 05/06/13 19:44:57 ndbdev@stripped +1 -0 Logging to logging@stripped accepted ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 1.56 05/06/13 19:44:15 ndbdev@stripped +10 -6 Bug #11290 TransactionInactiveTimeout = 0 does not result in infinite timeout ndb/test/ndbapi/testTimeout.cpp 1.11 05/06/13 19:44:00 ndbdev@stripped +74 -12 Bug #11290 TransactionInactiveTimeout = 0 does not result in infinite timeout # 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: tulin # Host: dl145c.mysql.com # Root: /home/ndbdev/tomas/mysql-4.1 --- 1.398/BitKeeper/etc/logging_ok Tue Jun 7 15:33:37 2005 +++ 1.399/BitKeeper/etc/logging_ok Mon Jun 13 19:44:57 2005 @@ -176,6 +176,7 @@ mysqldev@stripped mysqldev@stripped ndbdev@stripped +ndbdev@stripped ndbdev@stripped ndbdev@stripped nick@stripped --- 1.55/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp Thu May 5 10:34:37 2005 +++ 1.56/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp Mon Jun 13 19:44:15 2005 @@ -722,11 +722,14 @@ void Dbtc::set_appl_timeout_value(Uint32 timeOut) { - timeOut /= 10; - if (timeOut < ctimeOutValue) { - jam(); - c_appl_timeout_value = ctimeOutValue; - }//if + if (timeOut) + { + timeOut /= 10; + if (timeOut < ctimeOutValue) { + jam(); + c_appl_timeout_value = ctimeOutValue; + }//if + } c_appl_timeout_value = timeOut; } @@ -6133,7 +6136,8 @@ particular state we will use the application timeout parameter rather than the shorter Deadlock detection timeout. */ - if ((ctcTimer - getApiConTimer(apiConnectptr.i)) <= c_appl_timeout_value) { + if (c_appl_timeout_value == 0 || + (ctcTimer - getApiConTimer(apiConnectptr.i)) <= c_appl_timeout_value) { jam(); return; }//if --- 1.10/ndb/test/ndbapi/testTimeout.cpp Wed Oct 13 11:43:52 2004 +++ 1.11/ndb/test/ndbapi/testTimeout.cpp Mon Jun 13 19:44:00 2005 @@ -22,14 +22,14 @@ #include #include -#define TIMEOUT 3000 - +#define TIMEOUT (Uint32)3000 Uint32 g_org_timeout = 3000; int setTransactionTimeout(NDBT_Context* ctx, NDBT_Step* step){ NdbRestarter restarter; - + int timeout = ctx->getProperty("TransactionInactiveTimeout",TIMEOUT); + NdbConfig conf(GETNDB(step)->getNodeId()+1); unsigned int nodeId = conf.getMasterNodeId(); if (!conf.getProperty(nodeId, @@ -39,7 +39,7 @@ return NDBT_FAILED; } - int val[] = { DumpStateOrd::TcSetApplTransactionTimeout, TIMEOUT }; + int val[] = { DumpStateOrd::TcSetApplTransactionTimeout, timeout }; if(restarter.dumpStateAllNodes(val, 2) != 0){ return NDBT_FAILED; } @@ -94,9 +94,11 @@ unsigned int nodeId = conf.getMasterNodeId(); int stepNo = step->getStepNo(); - int minSleep = (int)(TIMEOUT * 1.5); - int maxSleep = TIMEOUT * 2; - ndbout << "TransactionInactiveTimeout="<< TIMEOUT + int timeout = ctx->getProperty("TransactionInactiveTimeout",TIMEOUT); + + int minSleep = (int)(timeout * 1.5); + int maxSleep = timeout * 2; + ndbout << "TransactionInactiveTimeout="<< timeout << ", minSleep="<getNumRecords(); - int minSleep = (int)(TIMEOUT * 1.5); - int maxSleep = TIMEOUT * 2; + int timeout = ctx->getProperty("TransactionInactiveTimeout",TIMEOUT); + + int minSleep = (int)(timeout * 1.5); + int maxSleep = timeout * 2; HugoOperations hugoOps(*ctx->getTab()); Ndb* pNdb = GETNDB(step); @@ -148,7 +152,7 @@ op1 = (op1 % 5); op2 = (op2 % 5); - ndbout << stepNo << ": TransactionInactiveTimeout="<< TIMEOUT + ndbout << stepNo << ": TransactionInactiveTimeout="<< timeout << ", minSleep="<getNumLoops(); @@ -331,6 +382,17 @@ INITIALIZER(runLoadTable); INITIALIZER(setTransactionTimeout); STEPS(runDontTimeoutTrans, 1); + FINALIZER(resetTransactionTimeout); + FINALIZER(runClearTable); +} +TESTCASE("Bug11290", + "Setting TransactionInactiveTimeout to 0(zero) "\ + "should result in infinite timeout, and not as "\ + "was the bug, a timeout that is equal to the deadlock timeout"){ + TC_PROPERTY("TransactionInactiveTimeout",(Uint32)0); + INITIALIZER(runLoadTable); + INITIALIZER(setTransactionTimeout); + STEPS(runDeadlockTimeoutTrans, 1); FINALIZER(resetTransactionTimeout); FINALIZER(runClearTable); }