List:Commits« Previous MessageNext Message »
From:Tomas Ulin Date:October 2 2008 4:13pm
Subject:bzr push into mysql-5.1 branch (tomas.ulin:2701 to 2702)
View as plain text  
 2702 Tomas Ulin	2008-10-02 [merge]
      merge
modified:
  mysql-test/mysql-test-run.pl
  sql/ha_ndbcluster.cc
  sql/ha_ndbcluster_binlog.cc
  sql/ha_ndbcluster_binlog.h
  sql/ha_ndbcluster_connection.cc
  sql/ha_ndbcluster_connection.h
  sql/mysqld.cc

 2701 Tomas Ulin	2008-10-02 [merge]
      merge
modified:
  sql/ha_ndbcluster.cc

=== modified file 'mysql-test/mysql-test-run.pl'
--- a/mysql-test/mysql-test-run.pl	2008-09-02 16:31:03 +0000
+++ b/mysql-test/mysql-test-run.pl	2008-10-02 16:11:03 +0000
@@ -3981,7 +3981,6 @@ sub mysqld_arguments ($$$$) {
       }
       if ( $mysql_version_id >= 50100 )
       {
-	mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
         if ( ! $glob_use_embedded_server )
         {
           mtr_add_arg($args, "%s--ndb-log-orig", $prefix);
@@ -4064,7 +4063,6 @@ sub mysqld_arguments ($$$$) {
       }
       if ( $mysql_version_id >= 50100 )
       {
-	mtr_add_arg($args, "%s--ndb-extra-logging", $prefix);
         if ( ! $glob_use_embedded_server )
         {
           mtr_add_arg($args, "%s--ndb-log-orig", $prefix);

=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc	2008-10-02 14:55:27 +0000
+++ b/sql/ha_ndbcluster.cc	2008-10-02 16:11:03 +0000
@@ -165,7 +165,7 @@ HASH ndbcluster_open_tables;
 static uchar *ndbcluster_get_key(NDB_SHARE *share, size_t *length,
                                 my_bool not_used __attribute__((unused)));
 
-static int ndb_get_table_statistics(ha_ndbcluster*, bool, Ndb*,
+static int ndb_get_table_statistics(THD *thd, ha_ndbcluster*, bool, Ndb*,
                                     const NdbRecord *, struct Ndb_statistics *);
 
 THD *injector_thd= 0;
@@ -3183,7 +3183,7 @@ int ha_ndbcluster::ndb_write_row(uchar *
       Ndb_tuple_id_range_guard g(m_share);
       if (ndb->getAutoIncrementValue(m_table, g.range, auto_value, 1000) == -1)
       {
-	if (--retries &&
+	if (--retries && !thd->killed &&
 	    ndb->getNdbError().status == NdbError::TemporaryError)
 	{
 	  do_retry_sleep(retry_sleep);
@@ -7409,7 +7409,7 @@ void ha_ndbcluster::get_auto_increment(u
         ndb->readAutoIncrementValue(m_table, g.range, auto_value) ||
         ndb->getAutoIncrementValue(m_table, g.range, auto_value, cache_size, increment, offset))
     {
-      if (--retries &&
+      if (--retries && !thd->killed &&
           ndb->getNdbError().status == NdbError::TemporaryError)
       {
         do_retry_sleep(retry_sleep);
@@ -9184,7 +9184,7 @@ uint ndb_get_commitcount(THD *thd, char 
   {
     Ndb_table_guard ndbtab_g(ndb->getDictionary(), tabname);
     if (ndbtab_g.get_table() == 0
-        || ndb_get_table_statistics(NULL, 
+        || ndb_get_table_statistics(thd, NULL, 
                                     FALSE, 
                                     ndb, 
                                     ndbtab_g.get_table()->getDefaultRecord(),
@@ -9874,7 +9874,7 @@ int ha_ndbcluster::update_stats(THD *thd
     {
       DBUG_RETURN(my_errno= HA_ERR_OUT_OF_MEM);
     }
-    if (int err= ndb_get_table_statistics(this, TRUE, ndb,
+    if (int err= ndb_get_table_statistics(thd, this, TRUE, ndb,
                                           m_ndb_record, &stat))
     {
       DBUG_RETURN(err);
@@ -9912,7 +9912,7 @@ int ha_ndbcluster::update_stats(THD *thd
 
 static 
 int
-ndb_get_table_statistics(ha_ndbcluster* file, bool report_error, Ndb* ndb,
+ndb_get_table_statistics(THD *thd, ha_ndbcluster* file, bool report_error, Ndb* ndb,
                          const NdbRecord *record,
                          struct Ndb_statistics * ndbstat)
 {
@@ -10067,7 +10067,8 @@ retry:
       ndb->closeTransaction(pTrans);
       pTrans= NULL;
     }
-    if (error.status == NdbError::TemporaryError && retries--)
+    if (error.status == NdbError::TemporaryError &&
+        retries-- && !thd->killed)
     {
       do_retry_sleep(retry_sleep);
       continue;
@@ -10969,7 +10970,7 @@ pthread_handler_t ndb_util_thread_func(v
         }
         Ndb_table_guard ndbtab_g(ndb->getDictionary(), share->table_name);
         if (ndbtab_g.get_table() &&
-            ndb_get_table_statistics(NULL, FALSE, ndb,
+            ndb_get_table_statistics(thd, NULL, FALSE, ndb,
                                      ndbtab_g.get_table()->getDefaultRecord(), 
                                      &stat) == 0)
         {

=== modified file 'sql/ha_ndbcluster_binlog.cc'
--- a/sql/ha_ndbcluster_binlog.cc	2008-10-02 08:19:14 +0000
+++ b/sql/ha_ndbcluster_binlog.cc	2008-10-02 16:11:03 +0000
@@ -1271,7 +1271,7 @@ static int ndbcluster_find_all_databases
       ndb->closeTransaction(trans);
       trans= NULL;
     }
-    if (ndb_error.status == NdbError::TemporaryError)
+    if (ndb_error.status == NdbError::TemporaryError && !thd->killed)
     {
       if (retries--)
       {
@@ -1593,7 +1593,7 @@ ndbcluster_update_slock(THD *thd,
   err:
     const NdbError *this_error= trans ?
       &trans->getNdbError() : &ndb->getNdbError();
-    if (this_error->status == NdbError::TemporaryError)
+    if (this_error->status == NdbError::TemporaryError && !thd->killed)
     {
       if (retries--)
       {
@@ -1942,7 +1942,7 @@ int ndbcluster_log_schema_op(THD *thd,
 err:
     const NdbError *this_error= trans ?
       &trans->getNdbError() : &ndb->getNdbError();
-    if (this_error->status == NdbError::TemporaryError)
+    if (this_error->status == NdbError::TemporaryError && !thd->killed)
     {
       if (retries--)
       {
@@ -4392,7 +4392,7 @@ ndbcluster_create_event_ops(THD *thd, ND
       op->setCustomData(NULL);
       ndb->dropEventOperation(op);
       pthread_mutex_unlock(&injector_mutex);
-      if (retries)
+      if (retries && !thd->killed)
       {
         do_retry_sleep(retry_sleep);
         continue;

=== modified file 'sql/ha_ndbcluster_binlog.h'
--- a/sql/ha_ndbcluster_binlog.h	2008-10-02 08:19:14 +0000
+++ b/sql/ha_ndbcluster_binlog.h	2008-10-02 16:11:03 +0000
@@ -281,12 +281,6 @@ set_thd_ndb(THD *thd, Thd_ndb *thd_ndb)
 
 Ndb* check_ndb_in_thd(THD* thd);
 
-/* perform random sleep in the range milli_sleep to 2*milli_sleep */
-inline void do_retry_sleep(unsigned milli_sleep)
-{
-  my_sleep(1000*(milli_sleep + 5*(rand()%(milli_sleep/5))));
-}
-
 int ndbcluster_has_global_schema_lock(Thd_ndb *thd_ndb);
 int ndbcluster_no_global_schema_lock_abort(THD *thd, const char *msg);
 

=== modified file 'sql/ha_ndbcluster_connection.cc'
--- a/sql/ha_ndbcluster_connection.cc	2008-04-09 15:04:31 +0000
+++ b/sql/ha_ndbcluster_connection.cc	2008-10-02 16:11:03 +0000
@@ -96,7 +96,9 @@ int ndbcluster_connect(int (*connect_cal
         (now_time.tv_sec == end_time.tv_sec &&
          now_time.tv_usec >= end_time.tv_usec))
       break;
-    sleep(1);
+    do_retry_sleep(100);
+    if (abort_loop)
+      goto ndbcluster_connect_error;
   }
 
   {

=== modified file 'sql/ha_ndbcluster_connection.h'
--- a/sql/ha_ndbcluster_connection.h	2008-04-09 13:52:09 +0000
+++ b/sql/ha_ndbcluster_connection.h	2008-10-02 15:52:29 +0000
@@ -23,3 +23,9 @@ int ndb_has_node_id(uint id);
 
 /* options from from mysqld.cc */
 extern ulong opt_ndb_cluster_connection_pool;
+
+/* perform random sleep in the range milli_sleep to 2*milli_sleep */
+inline void do_retry_sleep(unsigned milli_sleep)
+{
+  my_sleep(1000*(milli_sleep + 5*(rand()%(milli_sleep/5))));
+}

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2008-10-01 10:05:46 +0000
+++ b/sql/mysqld.cc	2008-10-02 16:11:03 +0000
@@ -5984,7 +5984,7 @@ master-ssl",
    "Turn on more logging in the error log.",
    (uchar**) &ndb_extra_logging,
    (uchar**) &ndb_extra_logging,
-   0, GET_ULONG, OPT_ARG, 0, 0, 0, 0, 0, 0},
+   0, GET_ULONG, OPT_ARG, 1, 0, 0, 0, 0, 0},
 #ifdef HAVE_NDB_BINLOG
   {"ndb-report-thresh-binlog-epoch-slip", OPT_NDB_REPORT_THRESH_BINLOG_EPOCH_SLIP,
    "Threshold on number of epochs to be behind before reporting binlog status. "

Thread
bzr push into mysql-5.1 branch (tomas.ulin:2701 to 2702) Tomas Ulin3 Oct