From: Date: April 26 2006 3:47pm Subject: bk commit into 5.0 tree (tomas:1.2105) BUG#19202 List-Archive: http://lists.mysql.com/commits/5564 X-Bug: 19202 Message-Id: <20060426134738.919A41F313C@poseidon.mysql.com> Below is the list of changes that have just been committed into a local 5.0 repository of tomas. When tomas 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.2105 06/04/26 15:47:28 tomas@stripped +1 -0 Bug #19202 Incorrect errorhandling in select count(*) wrt temporary error - added retry handling of temporary transaction errors sql/ha_ndbcluster.cc 1.245 06/04/26 15:47:20 tomas@stripped +27 -5 Bug #19202 Incorrect errorhandling in select count(*) wrt temporary error - added retry handling of temporary transaction errors # 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: tomas # Host: poseidon.ndb.mysql.com # Root: /home/tomas/mysql-5.0 --- 1.244/sql/ha_ndbcluster.cc 2006-04-25 12:40:16 +02:00 +++ 1.245/sql/ha_ndbcluster.cc 2006-04-26 15:47:20 +02:00 @@ -5650,12 +5650,24 @@ { DBUG_ENTER("ndb_get_table_statistics"); DBUG_PRINT("enter", ("table: %s", table)); - NdbTransaction* pTrans= ndb->startTransaction(); - do + NdbTransaction* pTrans; + int retries= 10; + int retry_sleep= 30 * 1000; /* 30 milliseconds */ + + do { + pTrans= ndb->startTransaction(); if (pTrans == NULL) + { + if (ndb->getNdbError().status == NdbError::TemporaryError && + retries--) + { + my_sleep(retry_sleep); + continue; + } break; - + } + NdbScanOperation* pOp= pTrans->getNdbScanOperation(table); if (pOp == NULL) break; @@ -5678,8 +5690,18 @@ NdbTransaction::AbortOnError, TRUE); if (check == -1) + { + if (pTrans->getNdbError().status == NdbError::TemporaryError && + retries--) + { + ndb->closeTransaction(pTrans); + pTrans= 0; + my_sleep(retry_sleep); + continue; + } break; - + } + Uint32 count= 0; Uint64 sum_rows= 0; Uint64 sum_commits= 0; @@ -5713,7 +5735,7 @@ sum_mem, count)); DBUG_RETURN(0); - } while (0); + } while(1); if (pTrans) ndb->closeTransaction(pTrans);