List:Commits« Previous MessageNext Message »
From:jhe Date:August 15 2006 11:47am
Subject:bk commit into 5.1 tree (Justin.He:1.2275)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of justin.he. When justin.he 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, 2006-08-15 19:47:15+08:00, Justin.He@stripped +4 -0
  Merge qa3-104.qa.cn.tlan:/mnt/sda7/justin.he/mysql/mysql-5.0-ndb-bj
  into  qa3-104.qa.cn.tlan:/mnt/sda7/justin.he/mysql/mysql-5.1-ndb-bj
  MERGE: 1.1810.1972.22

  sql/sql_base.cc@stripped, 2006-08-15 19:47:03+08:00, Justin.He@stripped +0 -0
    Auto merged
    MERGE: 1.235.1.113

  sql/sql_view.cc@stripped, 2006-08-15 19:47:03+08:00, Justin.He@stripped +0 -0
    Auto merged
    MERGE: 1.78.1.18

  storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2006-08-15 19:47:04+08:00, Justin.He@stripped +0 -0
    Auto merged
    MERGE: 1.60.18.2

  storage/ndb/src/mgmsrv/ConfigInfo.cpp@stripped, 2006-08-15 19:47:02+08:00, Justin.He@stripped +0 -0
    Merge rename: ndb/src/mgmsrv/ConfigInfo.cpp -> storage/ndb/src/mgmsrv/ConfigInfo.cpp

  storage/ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2006-08-15 19:47:04+08:00, Justin.He@stripped +0 -0
    Auto merged
    MERGE: 1.73.32.2

  storage/ndb/src/mgmsrv/MgmtSrvr.cpp@stripped, 2006-08-15 19:47:03+08:00, Justin.He@stripped +0 -0
    Merge rename: ndb/src/mgmsrv/MgmtSrvr.cpp -> storage/ndb/src/mgmsrv/MgmtSrvr.cpp

# 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:	Justin.He
# Host:	qa3-104.qa.cn.tlan
# Root:	/mnt/sda7/justin.he/mysql/mysql-5.1-ndb-bj/RESYNC

--- 1.60.18.1/ndb/src/mgmsrv/ConfigInfo.cpp	2006-08-15 19:47:32 +08:00
+++ 1.86/storage/ndb/src/mgmsrv/ConfigInfo.cpp	2006-08-15 19:47:32 +08:00
@@ -762,6 +762,30 @@
     STR_VALUE(MAX_INT_RNIL)},
 
   {
+    CFG_DB_DISK_PAGE_BUFFER_MEMORY,
+    "DiskPageBufferMemory",
+    DB_TOKEN,
+    "Number bytes on each "DB_TOKEN_PRINT" node allocated for disk page buffer cache",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT64,
+    "64M",
+    "4M",
+    "1024G" },
+
+  {
+    CFG_DB_SGA,
+    "SharedGlobalMemory",
+    DB_TOKEN,
+    "Total number bytes on each "DB_TOKEN_PRINT" node allocated for any use",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT64,
+    "20M",
+    "0",
+    "65536G" }, // 32k pages * 32-bit i value
+  
+  {
     CFG_DB_START_PARTIAL_TIMEOUT,
     "StartPartialTimeout",
     DB_TOKEN,
@@ -853,7 +877,7 @@
     ConfigInfo::CI_USED,
     false,
     ConfigInfo::CI_INT,
-    "8",
+    "16",
     "3",
     STR_VALUE(MAX_INT_RNIL) },
 
@@ -870,6 +894,18 @@
     STR_VALUE(MAX_INT_RNIL) },
   
   {
+    CFG_DB_INITIAL_OPEN_FILES,
+    "InitialNoOfOpenFiles",
+    DB_TOKEN,
+    "Initial number of files open per "DB_TOKEN_PRINT" node.(One thread is created per file)",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT,
+    "27",
+    "20",
+    STR_VALUE(MAX_INT_RNIL) },
+  
+  {
     CFG_DB_TRANSACTION_CHECK_INTERVAL,
     "TimeBetweenInactiveTransactionAbortCheck",
     DB_TOKEN,
@@ -916,8 +952,8 @@
     CFG_DB_LCP_DISC_PAGES_TUP_SR,
     "NoOfDiskPagesToDiskDuringRestartTUP",
     DB_TOKEN,
-    "?",
-    ConfigInfo::CI_USED,
+    "DiskCheckpointSpeedSr",
+    ConfigInfo::CI_DEPRICATED,
     true,
     ConfigInfo::CI_INT,
     "40",
@@ -928,8 +964,8 @@
     CFG_DB_LCP_DISC_PAGES_TUP,
     "NoOfDiskPagesToDiskAfterRestartTUP",
     DB_TOKEN,
-    "?",
-    ConfigInfo::CI_USED,
+    "DiskCheckpointSpeed",
+    ConfigInfo::CI_DEPRICATED,
     true,
     ConfigInfo::CI_INT,
     "40",
@@ -940,8 +976,8 @@
     CFG_DB_LCP_DISC_PAGES_ACC_SR,
     "NoOfDiskPagesToDiskDuringRestartACC",
     DB_TOKEN,
-    "?",
-    ConfigInfo::CI_USED,
+    "DiskCheckpointSpeedSr",
+    ConfigInfo::CI_DEPRICATED,
     true,
     ConfigInfo::CI_INT,
     "20",
@@ -952,8 +988,8 @@
     CFG_DB_LCP_DISC_PAGES_ACC,
     "NoOfDiskPagesToDiskAfterRestartACC",
     DB_TOKEN,
-    "?",
-    ConfigInfo::CI_USED,
+    "DiskCheckpointSpeed",
+    ConfigInfo::CI_DEPRICATED,
     true,
     ConfigInfo::CI_INT,
     "20",
@@ -1156,6 +1192,42 @@
     0, 0 },
   
   { 
+    CFG_DB_DISK_SYNCH_SIZE,
+    "DiskSyncSize",
+    DB_TOKEN,
+    "Data written to a file before a synch is forced",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT,
+    "4M",
+    "32k",
+    STR_VALUE(MAX_INT_RNIL) },
+  
+  { 
+    CFG_DB_CHECKPOINT_SPEED,
+    "DiskCheckpointSpeed",
+    DB_TOKEN,
+    "Bytes per second allowed to be written by checkpoint",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT,
+    "10M",
+    "1M",
+    STR_VALUE(MAX_INT_RNIL) },
+  
+  { 
+    CFG_DB_CHECKPOINT_SPEED_SR,
+    "DiskCheckpointSpeedInRestart",
+    DB_TOKEN,
+    "Bytes per second allowed to be written by checkpoint during restart",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT,
+    "100M",
+    "1M",
+    STR_VALUE(MAX_INT_RNIL) },
+  
+  { 
     CFG_DB_BACKUP_MEM,
     "BackupMemory",
     DB_TOKEN,
@@ -1215,6 +1287,18 @@
     "2K",
     STR_VALUE(MAX_INT_RNIL) },
 
+  { 
+    CFG_DB_STRING_MEMORY,
+    "StringMemory",
+    DB_TOKEN,
+    "Default size of string memory (0 -> 5% of max 1-100 -> %of max, >100 -> actual bytes)",
+    ConfigInfo::CI_USED,
+    false,
+    ConfigInfo::CI_INT,
+    "0",
+    "0",
+    STR_VALUE(MAX_INT_RNIL) },
+  
   /***************************************************************************
    * API
    ***************************************************************************/

--- 1.73.32.1/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-15 19:47:32 +08:00
+++ 1.104/storage/ndb/src/mgmsrv/MgmtSrvr.cpp	2006-08-15 19:47:32 +08:00
@@ -37,10 +37,10 @@
 #include <signaldata/EventReport.hpp>
 #include <signaldata/DumpStateOrd.hpp>
 #include <signaldata/BackupSignalData.hpp>
-#include <signaldata/GrepImpl.hpp>
 #include <signaldata/ManagementServer.hpp>
 #include <signaldata/NFCompleteRep.hpp>
 #include <signaldata/NodeFailRep.hpp>
+#include <signaldata/AllocNodeId.hpp>
 #include <NdbSleep.h>
 #include <EventLogger.hpp>
 #include <DebuggerNames.hpp>
@@ -493,10 +493,6 @@
       case NODE_TYPE_MGM:
 	nodeTypes[id] = NDB_MGM_NODE_TYPE_MGM;
 	break;
-      case NODE_TYPE_REP:
-	nodeTypes[id] = NDB_MGM_NODE_TYPE_REP;
-	break;
-      case NODE_TYPE_EXT_REP:
       default:
 	break;
       }
@@ -579,8 +575,7 @@
       DBUG_RETURN(false);
     }
   }
-  theFacade= TransporterFacade::theFacadeInstance
-    = new TransporterFacade();
+  theFacade= new TransporterFacade();
   
   if(theFacade == 0) {
     DEBUG("MgmtSrvr.cpp: theFacade is NULL.");
@@ -1871,9 +1866,6 @@
     break;
   case GSN_EVENT_REP:
   {
-    EventReport *rep = (EventReport*) signal->getDataPtr();
-    if (rep->getNodeId() == 0)
-      rep->setNodeId(refToNode(signal->theSendersBlockRef));
     eventReport(signal->getDataPtr());
     break;
   }
@@ -1914,7 +1906,6 @@
       DBUG_VOID_RETURN;
     }
   }
-  
   rep->setNodeId(_ownNodeId);
   eventReport(theData);
   DBUG_VOID_RETURN;
@@ -1987,6 +1978,89 @@
   }
 }
 
+int
+MgmtSrvr::alloc_node_id_req(NodeId free_node_id, enum ndb_mgm_node_type type)
+{
+  SignalSender ss(theFacade);
+  ss.lock(); // lock will be released on exit
+
+  SimpleSignal ssig;
+  AllocNodeIdReq* req = CAST_PTR(AllocNodeIdReq, ssig.getDataPtrSend());
+  ssig.set(ss, TestOrd::TraceAPI, QMGR, GSN_ALLOC_NODEID_REQ,
+	   AllocNodeIdReq::SignalLength);
+  
+  req->senderRef = ss.getOwnRef();
+  req->senderData = 19;
+  req->nodeId = free_node_id;
+  req->nodeType = type;
+
+  int do_send = 1;
+  NodeId nodeId = 0;
+  while (1)
+  {
+    if (nodeId == 0)
+    {
+      bool next;
+      while((next = getNextNodeId(&nodeId, NDB_MGM_NODE_TYPE_NDB)) == true &&
+            theFacade->get_node_alive(nodeId) == false);
+      if (!next)
+        return NO_CONTACT_WITH_DB_NODES;
+      do_send = 1;
+    }
+    if (do_send)
+    {
+      if (ss.sendSignal(nodeId, &ssig) != SEND_OK) {
+        return SEND_OR_RECEIVE_FAILED;
+      }
+      do_send = 0;
+    }
+    
+    SimpleSignal *signal = ss.waitFor();
+
+    int gsn = signal->readSignalNumber();
+    switch (gsn) {
+    case GSN_ALLOC_NODEID_CONF:
+    {
+      const AllocNodeIdConf * const conf =
+        CAST_CONSTPTR(AllocNodeIdConf, signal->getDataPtr());
+      return 0;
+    }
+    case GSN_ALLOC_NODEID_REF:
+    {
+      const AllocNodeIdRef * const ref =
+        CAST_CONSTPTR(AllocNodeIdRef, signal->getDataPtr());
+      if (ref->errorCode == AllocNodeIdRef::NotMaster ||
+          ref->errorCode == AllocNodeIdRef::Busy)
+      {
+        do_send = 1;
+        nodeId = refToNode(ref->masterRef);
+        continue;
+      }
+      return ref->errorCode;
+    }
+    case GSN_NF_COMPLETEREP:
+    {
+      const NFCompleteRep * const rep =
+        CAST_CONSTPTR(NFCompleteRep, signal->getDataPtr());
+#ifdef VM_TRACE
+      ndbout_c("Node %d fail completed", rep->failedNodeId);
+#endif
+      if (rep->failedNodeId == nodeId)
+        nodeId = 0;
+      continue;
+    }
+    case GSN_NODE_FAILREP:{
+      // ignore NF_COMPLETEREP will come
+      continue;
+    }
+    default:
+      report_unknown_signal(signal);
+      return SEND_OR_RECEIVE_FAILED;
+    }
+  }
+  return 0;
+}
+
 bool
 MgmtSrvr::alloc_node_id(NodeId * nodeId, 
 			enum ndb_mgm_node_type type,
@@ -2117,6 +2191,39 @@
   }
   NdbMutex_Unlock(m_configMutex);
 
+  if (id_found && client_addr != 0)
+  {
+    int res = alloc_node_id_req(id_found, type);
+    unsigned save_id_found = id_found;
+    switch (res)
+    {
+    case 0:
+      // ok continue
+      break;
+    case NO_CONTACT_WITH_DB_NODES:
+      // ok continue
+      break;
+    default:
+      // something wrong
+      id_found = 0;
+      break;
+
+    }
+    if (id_found == 0)
+    {
+      char buf[128];
+      ndb_error_string(res, buf, sizeof(buf));
+      error_string.appfmt("Cluster refused allocation of id %d. Error: %d (%s).",
+			  save_id_found, res, buf);
+      g_eventLogger.warning("Cluster refused allocation of id %d. "
+                            "Connection from ip %s. "
+                            "Returned error string \"%s\"", save_id_found,
+                            inet_ntoa(((struct sockaddr_in *)(client_addr))->sin_addr),
+                            error_string.c_str());
+      DBUG_RETURN(false);
+    }
+  }
+
   if (id_found)
   {
     *nodeId= id_found;
@@ -2490,17 +2597,6 @@
   return ss.sendSignal(nodeId, &ssig) == SEND_OK ? 0 : SEND_OR_RECEIVE_FAILED;
 }
 
-
-/*****************************************************************************
- * Global Replication
- *****************************************************************************/
-
-int
-MgmtSrvr::repCommand(Uint32* repReqId, Uint32 request, bool waitCompleted)
-{
-  require(false);
-  return 0;
-}
 
 MgmtSrvr::Allocated_resources::Allocated_resources(MgmtSrvr &m)
   : m_mgmsrv(m)
Thread
bk commit into 5.1 tree (Justin.He:1.2275)jhe15 Aug