List:Internals« Previous MessageNext Message »
From:tomas Date:September 15 2005 6:00pm
Subject:bk commit into 5.1 tree (tomas:1.1905)
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.1905 05/09/15 18:00:41 tomas@stripped +1 -0
  improved printouts in error log for cluster binlog

  sql/ha_ndbcluster.cc
    1.215 05/09/15 18:00:35 tomas@stripped +34 -31
    improved printouts in error log for cluster binlog

# 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-wl2325-5.0

--- 1.214/sql/ha_ndbcluster.cc	2005-09-15 17:03:29 +02:00
+++ 1.215/sql/ha_ndbcluster.cc	2005-09-15 18:00:35 +02:00
@@ -8755,7 +8755,7 @@
   thd->clear_error();
   if (open_tables(thd,&tables,&counter,MYSQL_LOCK_IGNORE_FLUSH))
   {
-    sql_print_error("Opening binlog_index: %d, '%s'",
+    sql_print_error("NDB Binlog: Opening binlog_index: %d, '%s'",
 		    thd->net.last_errno,
 		    thd->net.last_error ? thd->net.last_error : "");
     thd->proc_info= save_proc_info;
@@ -9005,7 +9005,7 @@
 
   if (lock_tables(thd, &tables, 1, &need_reopen))
   {
-    sql_print_error("lock_tables 2");
+   sql_print_error("NDB Binlog: Unable to lock table binlog_index");
     error= -1;
     goto add_binlog_index_err;
   }
@@ -9022,7 +9022,7 @@
   int r;
   if ((r= binlog_index->file->write_row(binlog_index->record[0])))
   {
-    sql_print_error("Writing row to binlog_index: %d", r);
+    sql_print_error("NDB Binlog: Writing row to binlog_index: %d", r);
     error= -1;
     goto add_binlog_index_err;
   }
@@ -9180,16 +9180,14 @@
   {
     if (table->s->blob_fields)
     {
-      sql_print_error("NDB Binlog: "
-		      "binlog of blob table %s.%s is not supported",
-		      table->s->db,table->s->table_name);
+      sql_print_error("NDB Binlog: logging of blob table %s "
+		      "is not supported", share->key);
       DBUG_RETURN(0);
     }
     if (table->s->primary_key == MAX_KEY)
     {
-      sql_print_error("NDB Binlog: "
-		      "binlog of table %s.%s without a primary key is not supported",
-		      table->s->db,table->s->table_name);
+      sql_print_error("NDB Binlog: logging of table %s without a "
+		      "primary key is not supported", share->key);
       DBUG_RETURN(0);
     }
   }
@@ -9270,7 +9268,7 @@
   DBUG_PRINT("info",("%s share->op: 0x%lx, share->use_count: %u",
 		     share->key, share->op, share->use_count));
 
-  sql_print_information("NDB Binlog: replicating %s.", event_name);
+  sql_print_information("NDB Binlog: logging %s", share->key);
   DBUG_RETURN(0);
 }
 
@@ -9308,24 +9306,27 @@
 #ifdef SYNC_DROP_
   (void) pthread_mutex_lock(&share->mutex);
   int max_timeout= 10;
-  while (share->op && max_timeout)
+  while (share->op)
   {
     struct timespec abstime;
     set_timespec(abstime, 1);
-    sql_print_information("NDB delete table: "
-			  "waiting max %u sec for drop table %s.",
-			  max_timeout, share->key);
     (void) pthread_cond_timedwait(&injector_cond,
 				  &share->mutex,
 				  &abstime);
     max_timeout--;
+    if (share->op == 0)
+      break;
+    if (max_timeout == 0)
+    {
+      sql_print_error("NDB delete table: timed out. Ignoring...");
+      // ToDo: handle possible mem leak if cluster goes down and share is not freed...
+      break;
+    }
+    sql_print_information("NDB delete table: "
+			  "waiting max %u sec for drop table %s.",
+			  max_timeout, share->key);
   }
   (void) pthread_mutex_unlock(&share->mutex);
-  if (max_timeout == 0)
-  {
-    sql_print_error("NDB delete table: timed out. Ignoring...");
-    // ToDo: handle possible mem leak if cluster goes down and share is not freed...
-  }
 #else
   (void) pthread_mutex_lock(&share->mutex);
   share->op_old= share->op;
@@ -9363,8 +9364,7 @@
      */
     sql_print_error("NDB Binlog: Overrun in event buffer, "
 		    "this means we have dropped events. Cannot "
-		    "continue binlog for table %s.%s",
-		    share->db,share->table_name);
+		    "continue binlog for %s", share->key);
     pOp->clearError();
     return -1;
   }
@@ -9376,9 +9376,8 @@
      * and continue
      */
     sql_print_error("NDB Binlog: Not Consistent. Cannot "
-		    "continue binlog for %s.%s. Error code: %d"
-		    " Message: %s",
-		    share->db,share->table_name,
+		    "continue binlog for %s. Error code: %d"
+		    " Message: %s", share->key,
 		    pOp->getNdbError().code,
 		    pOp->getNdbError().message);
     pOp->clearError();
@@ -9388,8 +9387,8 @@
 #endif
     return 0;
   }
-  sql_print_information("NDB Binlog: unhandled error %d for table %s.%s",
-			pOp->hasError(),share->db,share->table_name);
+  sql_print_information("NDB Binlog: unhandled error %d for table %s",
+			pOp->hasError(),share->key);
   pOp->clearError();
   return 0;
 }
@@ -9416,17 +9415,21 @@
     }
     break;
   case NDBEVENT::TE_ALTER:
+    // ToDo: remove printout
+    sql_print_information("NDB Binlog: rename table %s%s/%s -> %s.",
+			  share_prefix, share->table->s->db,
+			  share->table->s->table_name,
+			  share->key);
     // do the rename of the table in the share
     share->table->s->db= share->db;
     share->table->s->table_name= share->table_name;
-    // fall through
+    goto drop_alter_common;
   case NDBEVENT::TE_DROP:
-    row.n_schemaops++;
     // ToDo: remove printout
-    sql_print_information("NDB Binlog: %s table %s.",
-			  type == NDBEVENT::TE_DROP ? "drop" : "alter",
+    sql_print_information("NDB Binlog: drop table %s.",
 			  share->key);
-
+drop_alter_common:
+    row.n_schemaops++;
     DBUG_PRINT("info",("TABLE %s EVENT: %s received share: 0x%lx op: %lx share op: %lx
op_old: %lx",
 		       type == NDBEVENT::TE_DROP ? "DROP" : "ALTER",
 		       share->key, share, pOp, share->op, share->op_old));
Thread
bk commit into 5.1 tree (tomas:1.1905)tomas15 Sep