List:Commits« Previous MessageNext Message »
From:lzhou Date:February 1 2007 6:39pm
Subject:bk commit into 5.1 tree (lzhou:1.2418)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of zhl. When zhl 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@stripped, 2007-02-01 17:34:20+00:00, lzhou@dev3-63.(none) +10 -0
  Merge dev3-63.(none):/home/zhl/mysql/tree-merge/5.1/mysql-5.1-new-ndb-bj
  into  dev3-63.(none):/home/zhl/mysql/tree-merge/5.1/mysql-5.1-new-ndb
  MERGE: 1.2336.1.9

  sql/log_event.cc@stripped, 2007-02-01 17:34:06+00:00, lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.252.6.1

  sql/protocol.h@stripped, 2007-02-01 17:34:06+00:00, lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.35.1.2

  sql/slave.cc@stripped, 2007-02-01 17:34:06+00:00, lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.298.1.1

  storage/ndb/src/common/debugger/EventLogger.cpp@stripped, 2007-02-01 17:34:07+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.30.1.2

  storage/ndb/src/kernel/blocks/backup/Backup.cpp@stripped, 2007-02-01 17:34:07+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.59.1.1

  storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp@stripped, 2007-02-01 17:34:08+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.126.1.1

  storage/ndb/src/mgmclient/CommandInterpreter.cpp@stripped, 2007-02-01 17:34:08+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.78.1.1

  storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2007-02-01 17:34:08+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.92.2.1

  storage/ndb/src/mgmsrv/main.cpp@stripped, 2007-02-01 17:34:08+00:00, lzhou@dev3-63.(none) +0
-0
    Auto merged
    MERGE: 1.51.1.1

  storage/ndb/src/ndbapi/ClusterMgr.cpp@stripped, 2007-02-01 17:34:08+00:00,
lzhou@dev3-63.(none) +0 -0
    Auto merged
    MERGE: 1.31.1.2

# 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:	lzhou
# Host:	dev3-63.(none)
# Root:	/home/zhl/mysql/tree-merge/5.1/mysql-5.1-new-ndb/RESYNC

--- 1.263/sql/log_event.cc	2007-02-01 17:37:38 +00:00
+++ 1.264/sql/log_event.cc	2007-02-01 17:37:38 +00:00
@@ -5717,9 +5717,26 @@
     {
       if (!need_reopen)
       {
-        slave_print_msg(ERROR_LEVEL, rli, error,
-                        "Error in %s event: when locking tables",
-                        get_type_str());
+        if (thd->query_error || thd->is_fatal_error)
+        {
+          /*
+            Error reporting borrowed from Query_log_event with many excessive
+            simplifications (we don't honour --slave-skip-errors)
+          */
+          uint actual_error= thd->net.last_errno;
+          slave_print_msg(ERROR_LEVEL, rli, actual_error,
+                          "Error '%s' in %s event: when locking tables",
+                          (actual_error ? thd->net.last_error :
+                           "unexpected success or fatal error"),
+                          get_type_str());
+          thd->is_fatal_error= 1;
+        }
+        else
+        {
+          slave_print_msg(ERROR_LEVEL, rli, error,
+                         "Error in %s event: when locking tables",
+                         get_type_str());
+        }
         rli->clear_tables_to_lock();
         DBUG_RETURN(error);
       }

--- 1.302/sql/slave.cc	2007-02-01 17:37:38 +00:00
+++ 1.303/sql/slave.cc	2007-02-01 17:37:38 +00:00
@@ -1295,7 +1295,7 @@
     rpl_filter->get_wild_ignore_table(&tmp);
     protocol->store(&tmp);
 
-    protocol->store((uint32) mi->rli.last_slave_errno);
+    protocol->store(mi->rli.last_slave_errno);
     protocol->store(mi->rli.last_slave_error, &my_charset_bin);
     protocol->store((uint32) mi->rli.slave_skip_counter);
     protocol->store((ulonglong) mi->rli.group_master_log_pos);

--- 1.32/storage/ndb/src/common/debugger/EventLogger.cpp	2007-02-01 17:37:38 +00:00
+++ 1.33/storage/ndb/src/common/debugger/EventLogger.cpp	2007-02-01 17:37:38 +00:00
@@ -2,8 +2,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+   the Free Software Foundation; version 2 of the License.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -116,7 +115,8 @@
   int sphase        = theData[4];
   int extra         = theData[5];
   getRestartAction(theData[1],action_str);
-  reason_str.appfmt(" Initiated by signal %d.", signum);
+  if (signum)
+    reason_str.appfmt(" Initiated by signal %d.", signum);
   if (error)
   {
     ndbd_exit_classification cl;

--- 1.96/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2007-02-01 17:37:38 +00:00
+++ 1.97/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2007-02-01 17:37:38 +00:00
@@ -3615,6 +3615,7 @@
   Uint32 db_nodes= 0;
   Uint32 replicas= 0;
   Uint32 db_host_count= 0;
+  bool  with_arbitration_rank= false;
   ctx.m_userProperties.get(DB_TOKEN, &db_nodes);
   ctx.m_userProperties.get("NoOfReplicas", &replicas);
   if((db_nodes % replicas) != 0){
@@ -3650,83 +3651,90 @@
       tmp->get("HostName", &host);
 
       if (strcmp(type,DB_TOKEN) == 0)
-      {
-	{
-	  Uint32 ii;
-	  if (!p_db_hosts.get(host,&ii))
-	    db_host_count++;
-	  p_db_hosts.put(host,i);
-	  if (p_arbitrators.get(host,&ii))
-	  {
-	    arbitration_warning.appfmt(arbit_warn_fmt, ii, i, host);
-	    p_arbitrators.remove(host); // only one warning per db node
-	  }
-	}
-	{
-	  unsigned j;
-	  BaseString str, str2;
-	  str.assfmt("#group%d_",group);
-	  p_db_hosts.put(str.c_str(),i_group,host);
-	  str2.assfmt("##group%d_",group);
-	  p_db_hosts.put(str2.c_str(),i_group,i);
-	  for (j= 0; j < i_group; j++)
-	  {
-	    const char *other_host;
-	    p_db_hosts.get(str.c_str(),j,&other_host);
-	    if (strcmp(host,other_host) == 0) {
-	      unsigned int other_i, c= 0;
-	      p_db_hosts.get(str2.c_str(),j,&other_i);
-	      p_db_hosts.get(str.c_str(),&c);
-	      if (c == 0) // first warning in this node group
-		node_group_warning.appfmt("  Node group %d", group);
-	      c|= 1 << j;
-	      p_db_hosts.put(str.c_str(),c);
-
-	      node_group_warning.appfmt(",\n    db node with id %d and id %d "
-					"on same host %s", other_i, i, host);
-	    }
-	  }
-	  i_group++;
-	  DBUG_ASSERT(i_group <= replicas);
-	  if (i_group == replicas)
-	  {
-	    unsigned c= 0;
-	    p_db_hosts.get(str.c_str(),&c);
-	    if (c+1 == (1u << (replicas-1))) // all nodes on same machine
-	      node_group_warning.append(".\n    Host failure will "
-					"cause complete cluster shutdown.");
-	    else if (c > 0)
-	      node_group_warning.append(".\n    Host failure may "
-					"cause complete cluster shutdown.");
-	    group++;
-	    i_group= 0;
-	  }
-	}
+      { 
+        { 
+          Uint32 ii; 
+          if (!p_db_hosts.get(host,&ii)) 
+            db_host_count++; 
+          p_db_hosts.put(host,i); 
+          if (p_arbitrators.get(host,&ii)) 
+          { 
+            arbitration_warning.appfmt(arbit_warn_fmt, ii, i, host); 
+            p_arbitrators.remove(host); // only one warning per db node 
+          } 
+        } 
+        { 
+          unsigned j; 
+          BaseString str, str2; 
+          str.assfmt("#group%d_",group); 
+          p_db_hosts.put(str.c_str(),i_group,host); 
+          str2.assfmt("##group%d_",group); 
+          p_db_hosts.put(str2.c_str(),i_group,i); 
+          for (j= 0; j < i_group; j++) 
+          { 
+            const char *other_host; 
+            p_db_hosts.get(str.c_str(),j,&other_host); 
+            if (strcmp(host,other_host) == 0) { 
+              unsigned int other_i, c= 0; 
+              p_db_hosts.get(str2.c_str(),j,&other_i); 
+              p_db_hosts.get(str.c_str(),&c); 
+              if (c == 0) // first warning in this node group 
+                node_group_warning.appfmt("  Node group %d", group); 
+              c|= 1 << j; 
+              p_db_hosts.put(str.c_str(),c); 
+              node_group_warning.appfmt(",\n    db node with id %d and id %d " 
+              "on same host %s", other_i, i, host); 
+            } 
+          } 
+          i_group++; 
+          DBUG_ASSERT(i_group <= replicas); 
+          if (i_group == replicas) 
+          { 
+            unsigned c= 0; 
+            p_db_hosts.get(str.c_str(),&c); 
+            if (c+1 == (1u << (replicas-1))) // all nodes on same machine 
+              node_group_warning.append(".\n    Host failure will " 
+              "cause complete cluster shutdown."); 
+            else if (c > 0) 
+              node_group_warning.append(".\n    Host failure may " 
+              "cause complete cluster shutdown."); 
+            group++; 
+            i_group= 0; 
+          } 
+        }
       }
       else if (strcmp(type,API_TOKEN) == 0 ||
 	       strcmp(type,MGM_TOKEN) == 0)
-      {
-	Uint32 rank;
-	if(tmp->get("ArbitrationRank", &rank) && rank > 0)
-	{
-	  if(host && host[0] != 0)
-	  {
-	    Uint32 ii;
-	    p_arbitrators.put(host,i);
-	    if (p_db_hosts.get(host,&ii))
-	    {
-	      arbitration_warning.appfmt(arbit_warn_fmt, i, ii, host);
-	    }
-	  }
-	  else
-	  {
-	    arbitration_warning.appfmt(arbit_warn_fmt2, i);
-	  }
-	}
+      { 
+        Uint32 rank; 
+        if(tmp->get("ArbitrationRank", &rank) && rank > 0) 
+        { 
+          with_arbitration_rank = true;  //check whether MGM or API node configured with
rank >0 
+          if(host && host[0] != 0) 
+          { 
+            Uint32 ii; 
+            p_arbitrators.put(host,i); 
+            if (p_db_hosts.get(host,&ii)) 
+            { 
+              arbitration_warning.appfmt(arbit_warn_fmt, i, ii, host); 
+            } 
+          } 
+          else 
+          { 
+            arbitration_warning.appfmt(arbit_warn_fmt2, i); 
+          } 
+        }
       }
     }
     if (db_host_count > 1 && node_group_warning.length() > 0)
       ndbout_c("Cluster configuration warning:\n%s",node_group_warning.c_str());
+    if (!with_arbitration_rank) 
+    {
+      ndbout_c("Cluster configuration warning:" 
+         "\n  Neither %s nor %s nodes are configured with arbitrator,"
+         "\n  may cause complete cluster shutdown in case of host failure.", 
+         MGM_TOKEN, API_TOKEN);
+    }
     if (db_host_count > 1 && arbitration_warning.length() > 0)
       ndbout_c("Cluster configuration warning:%s%s",arbitration_warning.c_str(),
 	       "\n  Running arbitrator on the same host as a database node may"

--- 1.62/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2007-02-01 17:37:38 +00:00
+++ 1.63/storage/ndb/src/kernel/blocks/backup/Backup.cpp	2007-02-01 17:37:38 +00:00
@@ -2405,6 +2405,18 @@
   if(ptr.p->is_lcp()) 
   {
     jam();
+     if (ptr.p->ctlFilePtr == RNIL) {
+       ptr.p->m_gsn = GSN_DEFINE_BACKUP_REF;
+       ndbrequire(ptr.p->errorCode != 0);
+       DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtrSend();
+       ref->backupId = ptr.p->backupId;
+       ref->backupPtr = ptr.i;
+       ref->errorCode = ptr.p->errorCode;
+       ref->nodeId = getOwnNodeId();
+       sendSignal(ptr.p->masterRef, GSN_DEFINE_BACKUP_REF, signal,
+                  DefineBackupRef::SignalLength, JBB);
+       return;
+     }
 
     BackupFilePtr filePtr LINT_SET_PTR;
     ptr.p->files.getPtr(filePtr, ptr.p->ctlFilePtr);

--- 1.132/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-02-01 17:37:38 +00:00
+++ 1.133/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2007-02-01 17:37:38 +00:00
@@ -582,6 +582,26 @@
 {
   jamEntry();
   m_backup_ptr = RNIL;
+  DefineBackupRef* ref = (DefineBackupRef*)signal->getDataPtrSend();
+  int err_code = 0;
+  char * extra_msg = NULL;
+
+  switch(ref->errorCode){
+    case DefineBackupRef::Undefined:
+    case DefineBackupRef::FailedToSetupFsBuffers:
+    case DefineBackupRef::FailedToAllocateBuffers: 
+    case DefineBackupRef::FailedToAllocateTables: 
+    case DefineBackupRef::FailedAllocateTableMem: 
+    case DefineBackupRef::FailedToAllocateFileRecord:
+    case DefineBackupRef::FailedToAllocateAttributeRecord:
+    case DefineBackupRef::FailedInsertFileHeader: 
+    case DefineBackupRef::FailedInsertTableList: 
+      jam();
+      err_code = NDBD_EXIT_INVALID_CONFIG;
+      extra_msg = "Probably Backup parameters configuration error, Please consult the
manual";
+      progError(__LINE__, err_code, extra_msg);
+  }
+
   sendsttorryLab(signal);
 }
 

--- 1.80/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2007-02-01 17:37:38 +00:00
+++ 1.81/storage/ndb/src/mgmclient/CommandInterpreter.cpp	2007-02-01 17:37:38 +00:00
@@ -2057,6 +2057,18 @@
     ndbout << processId << ": Node not found" << endl;
     return -1;
   }
+  if (cl->node_states[i].node_type != NDB_MGM_NODE_TYPE_NDB){
+    if (cl->node_states[i].version != 0){
+      ndbout << "Node "<< cl->node_states[i].node_id <<": connected"
;
+      ndbout_c(" (Version %d.%d.%d)",
+             getMajor(version) ,
+             getMinor(version),
+             getBuild(version));
+
+    }else
+     ndbout << "Node "<< cl->node_states[i].node_id <<": not
connected" << endl;
+    return 0;
+  } 
   status = cl->node_states[i].node_status;
   startPhase = cl->node_states[i].start_phase;
   version = cl->node_states[i].version;

--- 1.52/storage/ndb/src/mgmsrv/main.cpp	2007-02-01 17:37:38 +00:00
+++ 1.53/storage/ndb/src/mgmsrv/main.cpp	2007-02-01 17:37:38 +00:00
@@ -2,8 +2,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+   the Free Software Foundation; version 2 of the License.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 1.32/storage/ndb/src/ndbapi/ClusterMgr.cpp	2007-02-01 17:37:38 +00:00
+++ 1.33/storage/ndb/src/ndbapi/ClusterMgr.cpp	2007-02-01 17:37:38 +00:00
@@ -2,8 +2,7 @@
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+   the Free Software Foundation; version 2 of the License.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -489,6 +488,7 @@
   theNode.m_info.m_version = 0;
   theNode.compatible = true;
   theNode.nfCompleteRep = true;
+  theNode.m_state.startLevel = NodeState::SL_NOTHING;
   
   theFacade.ReportNodeAlive(nodeId);
   DBUG_VOID_RETURN;
@@ -501,14 +501,13 @@
 
   noOfConnectedNodes--;
   theNodes[nodeId].connected = false;
-
   theNodes[nodeId].m_state.m_connected_nodes.clear();
 
-  reportNodeFailed(nodeId);
+  reportNodeFailed(nodeId, true);
 }
 
 void
-ClusterMgr::reportNodeFailed(NodeId nodeId){
+ClusterMgr::reportNodeFailed(NodeId nodeId, bool disconnect){
 
   Node & theNode = theNodes[nodeId];
  
@@ -519,10 +518,11 @@
   {
     theFacade.doDisconnect(nodeId);
   }
+  
   const bool report = (theNode.m_state.startLevel != NodeState::SL_NOTHING);  
   theNode.m_state.startLevel = NodeState::SL_NOTHING;
   
-  if(report)
+  if(disconnect || report)
   {
     theFacade.ReportNodeDead(nodeId);
   }

--- 1.36/sql/protocol.h	2007-02-01 17:37:39 +00:00
+++ 1.37/sql/protocol.h	2007-02-01 17:37:39 +00:00
@@ -1,9 +1,8 @@
-/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
+/* Copyright (C) 2002-2006 MySQL AB
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
+   the Free Software Foundation; version 2 of the License.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
Thread
bk commit into 5.1 tree (lzhou:1.2418)lzhou2 Feb