MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:tomas Date:May 17 2006 6:35am
Subject:bk commit into 5.1 tree (tomas:1.2152) BUG#16875
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 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.2152 06/05/17 08:34:48 tomas@stripped +5 -0
  Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail

  storage/ndb/tools/desc.cpp
    1.24 06/05/17 08:34:41 tomas@stripped +7 -1
    Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
    - added retry option so that ndb_desc can be used to wait for a table to be created

  storage/ndb/src/ndbapi/DictCache.cpp
    1.25 06/05/17 08:34:41 tomas@stripped +14 -0
    Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
    - cache not released properly

  sql/ha_ndbcluster_binlog.cc
    1.54 06/05/17 08:34:41 tomas@stripped +2 -1
    Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
    - small correction of previous patch

  mysql-test/t/ndb_autodiscover3.test
    1.3 06/05/17 08:34:41 tomas@stripped +6 -2
    Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail

  mysql-test/r/ndb_autodiscover3.result
    1.4 06/05/17 08:34:41 tomas@stripped +4 -0
    Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail

# 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.1-new-ndb

--- 1.24/storage/ndb/src/ndbapi/DictCache.cpp	2006-05-16 10:37:33 +02:00
+++ 1.25/storage/ndb/src/ndbapi/DictCache.cpp	2006-05-17 08:34:41 +02:00
@@ -178,6 +178,11 @@
       {
         ver->m_status = DROPPED;
         retreive = true; // Break loop
+        if (ver->m_refCount == 0)
+        {
+          delete ver->m_impl;
+          versions->erase(versions->size() - 1);
+        }
         break;
       }
       ver->m_refCount++;
@@ -289,6 +294,10 @@
     sz += curr->theData->size();
     curr = m_tableHash.getNext(curr);
   }
+  if (sz)
+  {
+    printCache();
+  }
   return sz;
 }
 
@@ -408,6 +417,11 @@
       ver.m_status = DROPPED;
       ver.m_impl->m_status = altered ? 
 	NdbDictionary::Object::Altered : NdbDictionary::Object::Invalid;
+      if (ver.m_refCount == 0)
+      {
+        delete ver.m_impl;
+        vers->erase(i);
+      }
       DBUG_VOID_RETURN;
     }
 

--- 1.23/storage/ndb/tools/desc.cpp	2006-03-24 07:43:52 +01:00
+++ 1.24/storage/ndb/tools/desc.cpp	2006-05-17 08:34:41 +02:00
@@ -18,6 +18,7 @@
 #include <ndb_opts.h>
 #include <NDBT.hpp>
 #include <NdbApi.hpp>
+#include <NdbSleep.h>
 
 void desc_AutoGrowSpecification(struct NdbDictionary::AutoGrowSpecification ags);
 int desc_logfilegroup(Ndb *myndb, char* name);
@@ -31,6 +32,7 @@
 static const char* _dbname = "TEST_DB";
 static int _unqualified = 0;
 static int _partinfo = 0;
+static int _retries = 0;
 static struct my_option my_long_options[] =
 {
   NDB_STD_OPTS("ndb_desc"),
@@ -43,6 +45,9 @@
   { "extra-partition-info", 'p', "Print more info per partition",
     (gptr*) &_partinfo, (gptr*) &_partinfo, 0,
     GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0 }, 
+  { "retries", 'r', "Retry every second for # retries",
+    (gptr*) &_retries, (gptr*) &_retries, 0,
+    GET_INT, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, 
   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}
 };
 static void usage()
@@ -231,7 +236,8 @@
 int desc_table(Ndb *myndb, char* name)
 {
   NdbDictionary::Dictionary * dict= myndb->getDictionary();
-  NDBT_Table* pTab = (NDBT_Table*)dict->getTable(name);
+  NDBT_Table* pTab;
+  while ((pTab = (NDBT_Table*)dict->getTable(name)) == NULL && --_retries >= 0) NdbSleep_SecSleep(1);
   if (!pTab)
     return 0;
 

--- 1.3/mysql-test/r/ndb_autodiscover3.result	2006-05-16 20:56:38 +02:00
+++ 1.4/mysql-test/r/ndb_autodiscover3.result	2006-05-17 08:34:41 +02:00
@@ -14,6 +14,8 @@
 1	1
 2	1
 3	1
+select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
 show tables like 't2';
 Tables_in_test (t2)
 create table t2 (a int key) engine=ndbcluster;
@@ -28,6 +30,8 @@
 1
 2
 3
+select * from t2;
+ERROR 42S02: Table 'test.t2' doesn't exist
 show tables like 't2';
 Tables_in_test (t2)
 create table t2 (a int key) engine=ndbcluster;

--- 1.2/mysql-test/t/ndb_autodiscover3.test	2006-05-16 20:56:38 +02:00
+++ 1.3/mysql-test/t/ndb_autodiscover3.test	2006-05-17 08:34:41 +02:00
@@ -37,9 +37,11 @@
 --exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
 --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
 # to ensure mysqld has connected again, and recreated system tables
---sleep 3
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster apply_status >> $NDB_TOOLS_OUTPUT
 
 --connection server2
+--error ER_NO_SUCH_TABLE
+select * from t2;
 show tables like 't2';
 create table t2 (a int key) engine=ndbcluster;
 insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
@@ -52,9 +54,11 @@
 --exec $NDB_MGM --no-defaults -e "all restart -i" >> $NDB_TOOLS_OUTPUT
 --exec $NDB_TOOLS_DIR/ndb_waiter --no-defaults >> $NDB_TOOLS_OUTPUT
 # to ensure mysqld has connected again, and recreated system tables
---sleep 3
+--exec $NDB_TOOLS_DIR/ndb_desc --no-defaults -r 30 -d cluster apply_status >> $NDB_TOOLS_OUTPUT
 
 --connection server1
+--error ER_NO_SUCH_TABLE
+select * from t2;
 show tables like 't2';
 create table t2 (a int key) engine=ndbcluster;
 insert into t2 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);

--- 1.53/sql/ha_ndbcluster_binlog.cc	2006-05-16 20:56:38 +02:00
+++ 1.54/sql/ha_ndbcluster_binlog.cc	2006-05-17 08:34:41 +02:00
@@ -3318,6 +3318,7 @@
       schema_res= s_ndb->pollEvents(100, &schema_gci);
     }
     // now check that we have epochs consistant with what we had before the restart
+    DBUG_PRINT("info", ("schema_res: %d  schema_gci: %d", schema_res, schema_gci));
     if (schema_res > 0)
     {
       if (schema_gci < ndb_latest_handled_binlog_epoch)
@@ -3681,7 +3682,7 @@
     *root_ptr= old_root;
     ndb_latest_handled_binlog_epoch= ndb_latest_received_binlog_epoch;
   }
-  if (do_ndbcluster_binlog_close_connection != BCCC_exit)
+  if (do_ndbcluster_binlog_close_connection == BCCC_restart)
     goto restart;
 err:
   DBUG_PRINT("info",("Shutting down cluster binlog thread"));
Thread
bk commit into 5.1 tree (tomas:1.2152) BUG#16875tomas17 May