MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jack andrews Date:April 16 2009 11:15am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jack:2870)
View as plain text  
#At file:///C:/w/repo/70/ based on revid:jack@stripped

 2870 jack andrews	2009-04-16 [merge]
      merge

    modified:
      extra/yassl/include/openssl/ssl.h*
      include/my_socket_posix.h
      include/my_socket_win32.h
      include/violite.h
      storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp
      storage/ndb/src/common/util/version.c
      storage/ndb/src/kernel/blocks/LocalProxy.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.hpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp
      storage/ndb/src/mgmsrv/ConfigManager.cpp
      storage/ndb/src/mgmsrv/ConfigManager.hpp
      storage/ndb/test/ndbapi/testUpgrade.cpp
      vio/viossl.c
=== modified file 'extra/yassl/include/openssl/ssl.h' (properties changed: -x to +x)
--- a/extra/yassl/include/openssl/ssl.h	2008-12-08 17:45:48 +0000
+++ b/extra/yassl/include/openssl/ssl.h	2009-04-16 08:41:47 +0000
@@ -192,10 +192,17 @@ enum {  /* ERR Constants */
 };
 
 /*
-  Allow type used by SSL_set_fd to be changed, default to int
-  in order to be compatible with OpenSSL
- */
-#ifndef YASSL_SOCKET_T_DEFINED
+  Use platform default type for sockets except
+  if user explicitly request use of "int" to be
+  OpenSSL compatible
+*/
+#if !defined(YASSL_SET_FD_INT) && defined(_WIN32)
+#if defined(_WIN64)
+typedef unsigned __int64 YASSL_SOCKET_T;
+#else
+typedef unsigned int YASSL_SOCKET_T;
+#endif
+#else
 typedef int YASSL_SOCKET_T;
 #endif
 

=== modified file 'include/my_socket_posix.h'
--- a/include/my_socket_posix.h	2008-10-06 10:56:52 +0000
+++ b/include/my_socket_posix.h	2009-04-15 15:10:00 +0000
@@ -32,6 +32,11 @@ static inline my_socket my_socket_create
   return s;
 }
 
+static inline int my_socket_get_fd(my_socket s)
+{
+  return s.fd;
+}
+
 static inline int my_socket_close(my_socket s)
 {
   return close(s.fd);

=== modified file 'include/my_socket_win32.h'
--- a/include/my_socket_win32.h	2008-11-17 21:00:50 +0000
+++ b/include/my_socket_win32.h	2009-04-15 15:10:00 +0000
@@ -27,6 +27,11 @@ static inline my_socket my_socket_create
   return s;
 }
 
+static inline SOCKET my_socket_get_fd(my_socket s)
+{
+  return s.s;
+}
+
 static inline int my_socket_close(my_socket s)
 {
   return closesocket(s.s);

=== modified file 'include/violite.h'
--- a/include/violite.h	2009-01-08 17:44:55 +0000
+++ b/include/violite.h	2009-04-15 15:10:00 +0000
@@ -101,9 +101,6 @@ my_bool	vio_poll_read(Vio *vio,uint time
 #ifndef YASSL_PREFIX
 #define YASSL_PREFIX
 #endif
-/* Set yaSSL to use same type as MySQL do for socket handles */
-typedef my_socket YASSL_SOCKET_T;
-#define YASSL_SOCKET_T_DEFINED
 #include <openssl/ssl.h>
 #include <openssl/err.h>
 

=== modified file 'storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp'
--- a/storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp	2007-12-04 10:13:37 +0000
+++ b/storage/ndb/include/kernel/signaldata/NodeStateSignalData.hpp	2009-04-16 08:52:27 +0000
@@ -82,6 +82,7 @@ class ChangeNodeStateConf {
    * Reciver
    */
   friend class NdbCntr;
+  friend class LocalProxy;
   
 public:
   STATIC_CONST( SignalLength = 1 );

=== modified file 'storage/ndb/src/common/util/version.c'
--- a/storage/ndb/src/common/util/version.c	2008-08-26 14:05:01 +0000
+++ b/storage/ndb/src/common/util/version.c	2009-04-15 13:55:56 +0000
@@ -110,10 +110,12 @@ void ndbSetOwnVersion() {}
 
 #ifndef TEST_VERSION
 struct NdbUpGradeCompatible ndbCompatibleTable_full[] = {
+  { MAKE_VERSION(7,0,NDB_VERSION_BUILD), MAKE_VERSION(7,0,0), UG_Range },
+  { MAKE_VERSION(7,0,NDB_VERSION_BUILD), MAKE_VERSION(6,4,0), UG_Range },
   /* Can only upgrade to 6.4.X from versions >= 6.3.17 due to change
    * in Transporter maximum sent message size
    */
-  { MAKE_VERSION(6,4,NDB_VERSION_BUILD), NDBD_MAX_RECVBYTESIZE_32K, UG_Range },
+  { MAKE_VERSION(7,0,NDB_VERSION_BUILD), NDBD_MAX_RECVBYTESIZE_32K, UG_Range },
   { MAKE_VERSION(6,3,NDB_VERSION_BUILD), MAKE_VERSION(6,2,1), UG_Range },
 
   { MAKE_VERSION(6,2,NDB_VERSION_BUILD), MAKE_VERSION(6,2,1), UG_Range },

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2009-03-16 17:05:07 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2009-04-16 08:52:27 +0000
@@ -58,6 +58,13 @@ LocalProxy::LocalProxy(BlockNumber block
   addRecSignal(GSN_INCL_NODEREQ, &LocalProxy::execINCL_NODEREQ);
   addRecSignal(GSN_INCL_NODECONF, &LocalProxy::execINCL_NODECONF);
 
+  // GSN_NODE_STATE_REP
+  addRecSignal(GSN_NODE_STATE_REP, &LocalProxy::execNODE_STATE_REP, true);
+
+  // GSN_CHANGE_NODE_STATE_REQ
+  addRecSignal(GSN_CHANGE_NODE_STATE_REQ, &LocalProxy::execCHANGE_NODE_STATE_REQ, true);
+  addRecSignal(GSN_CHANGE_NODE_STATE_CONF, &LocalProxy::execCHANGE_NODE_STATE_CONF);
+
   // GSN_DUMP_STATE_ORD
   addRecSignal(GSN_DUMP_STATE_ORD, &LocalProxy::execDUMP_STATE_ORD);
 
@@ -666,6 +673,78 @@ LocalProxy::sendINCL_NODECONF(Signal* si
   ssRelease<Ss_INCL_NODEREQ>(ssId);
 }
 
+// GSN_NODE_STATE_REP
+
+void
+LocalProxy::execNODE_STATE_REP(Signal* signal)
+{
+  Ss_NODE_STATE_REP& ss = ssSeize<Ss_NODE_STATE_REP>();
+  sendREQ(signal, ss);
+  SimulatedBlock::execNODE_STATE_REP(signal);
+  ssRelease<Ss_NODE_STATE_REP>(ss);
+}
+
+void
+LocalProxy::sendNODE_STATE_REP(Signal* signal, Uint32 ssId)
+{
+  Ss_NODE_STATE_REP& ss = ssFind<Ss_NODE_STATE_REP>(ssId);
+
+  sendSignal(workerRef(ss.m_worker), GSN_NODE_STATE_REP,
+             signal,NodeStateRep::SignalLength, JBB);
+}
+
+// GSN_CHANGE_NODE_STATE_REQ
+
+void
+LocalProxy::execCHANGE_NODE_STATE_REQ(Signal* signal)
+{
+  Ss_CHANGE_NODE_STATE_REQ& ss = ssSeize<Ss_CHANGE_NODE_STATE_REQ>(1);
+
+  ChangeNodeStateReq * req = (ChangeNodeStateReq*)signal->getDataPtrSend();
+  ss.m_req = *req;
+
+  sendREQ(signal, ss);
+}
+
+void
+LocalProxy::sendCHANGE_NODE_STATE_REQ(Signal* signal, Uint32 ssId)
+{
+  Ss_CHANGE_NODE_STATE_REQ& ss = ssFind<Ss_CHANGE_NODE_STATE_REQ>(ssId);
+
+  ChangeNodeStateReq * req = (ChangeNodeStateReq*)signal->getDataPtrSend();
+  req->senderRef = reference();
+
+  sendSignal(workerRef(ss.m_worker), GSN_CHANGE_NODE_STATE_REQ,
+             signal, ChangeNodeStateReq::SignalLength, JBB);
+}
+
+void
+LocalProxy::execCHANGE_NODE_STATE_CONF(Signal* signal)
+{
+  Ss_CHANGE_NODE_STATE_REQ& ss = ssFind<Ss_CHANGE_NODE_STATE_REQ>(1);
+
+  ChangeNodeStateConf * conf = (ChangeNodeStateConf*)signal->getDataPtrSend();
+  ndbrequire(conf->senderData == ss.m_req.senderData);
+  recvCONF(signal, ss);
+}
+
+void
+LocalProxy::sendCHANGE_NODE_STATE_CONF(Signal* signal, Uint32 ssId)
+{
+  Ss_CHANGE_NODE_STATE_REQ& ss = ssFind<Ss_CHANGE_NODE_STATE_REQ>(ssId);
+
+  if (!lastReply(ss))
+    return;
+
+  /**
+   * SimulatedBlock::execCHANGE_NODE_STATE_REQ will reply
+   */
+  ChangeNodeStateReq * req = (ChangeNodeStateReq*)signal->getDataPtrSend();
+  * req = ss.m_req;
+  SimulatedBlock::execCHANGE_NODE_STATE_REQ(signal);
+  ssRelease<Ss_CHANGE_NODE_STATE_REQ>(ssId);
+}
+
 // GSN_DUMP_STATE_ORD
 
 void

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2009-03-16 17:05:07 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2009-04-16 08:52:27 +0000
@@ -24,6 +24,7 @@
 #include <signaldata/NdbSttor.hpp>
 #include <signaldata/ReadNodesConf.hpp>
 #include <signaldata/NodeFailRep.hpp>
+#include <signaldata/NodeStateSignalData.hpp>
 #include <signaldata/NFCompleteRep.hpp>
 #include <signaldata/CreateTrigImpl.hpp>
 #include <signaldata/DropTrigImpl.hpp>
@@ -434,6 +435,39 @@ protected:
   void execINCL_NODECONF(Signal*);
   void sendINCL_NODECONF(Signal*, Uint32 ssId);
 
+  // GSN_NODE_STATE_REP
+  struct Ss_NODE_STATE_REP : SsParallel {
+    Ss_NODE_STATE_REP() {
+      m_sendREQ = &LocalProxy::sendNODE_STATE_REP;
+      m_sendCONF = 0;
+    }
+    enum { poolSize = 1 };
+    static SsPool<Ss_NODE_STATE_REP>& pool(LocalProxy* proxy) {
+      return proxy->c_ss_NODE_STATE_REP;
+    }
+  };
+  SsPool<Ss_NODE_STATE_REP> c_ss_NODE_STATE_REP;
+  void execNODE_STATE_REP(Signal*);
+  void sendNODE_STATE_REP(Signal*, Uint32 ssId);
+
+  // GSN_CHANGE_NODE_STATE_REQ
+  struct Ss_CHANGE_NODE_STATE_REQ : SsParallel {
+    ChangeNodeStateReq m_req;
+    Ss_CHANGE_NODE_STATE_REQ() {
+      m_sendREQ = &LocalProxy::sendCHANGE_NODE_STATE_REQ;
+      m_sendCONF = &LocalProxy::sendCHANGE_NODE_STATE_CONF;
+    }
+    enum { poolSize = 1 };
+    static SsPool<Ss_CHANGE_NODE_STATE_REQ>& pool(LocalProxy* proxy) {
+      return proxy->c_ss_CHANGE_NODE_STATE_REQ;
+    }
+  };
+  SsPool<Ss_CHANGE_NODE_STATE_REQ> c_ss_CHANGE_NODE_STATE_REQ;
+  void execCHANGE_NODE_STATE_REQ(Signal*);
+  void sendCHANGE_NODE_STATE_REQ(Signal*, Uint32 ssId);
+  void execCHANGE_NODE_STATE_CONF(Signal*);
+  void sendCHANGE_NODE_STATE_CONF(Signal*, Uint32 ssId);
+
   // GSN_DUMP_STATE_ORD
   struct Ss_DUMP_STATE_ORD : SsParallel {
     Uint32 m_reqlength;

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-03-24 08:42:42 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2009-04-15 14:08:26 +0000
@@ -139,6 +139,14 @@ create_obj_inc_schema_version(Uint32 old
   return (old + 0x00000001) & 0x00FFFFFF;
 }
 
+static
+void
+do_swap(Uint32 & v0, Uint32 & v1)
+{
+  Uint32 save = v0;
+  v0 = v1;
+  v1 = save;
+}
 
 /* **************************************************************** */
 /* ---------------------------------------------------------------- */
@@ -2230,21 +2238,20 @@ Uint32 Dbdict::getFsConnRecord() 
  */
 Uint32 Dbdict::getFreeObjId(Uint32 minId)
 {
-  const XSchemaFile * xsf = &c_schemaFile[SchemaRecord::NEW_SCHEMA_FILE];
-  Uint32 noOfPages = xsf->noOfPages;
-  Uint32 n, i;
-  for (n = 0; n < noOfPages; n++) {
-    jam();
-    const SchemaFile * sf = &xsf->schemaPage[n];
-    for (i = 0; i < NDB_SF_PAGE_ENTRIES; i++) {
-      const SchemaFile::TableEntry& te = sf->TableEntries[i];
-      if (te.m_tableState == (Uint32)SchemaFile::SF_UNUSED)
+  const XSchemaFile * newxsf = &c_schemaFile[SchemaRecord::NEW_SCHEMA_FILE];
+  const XSchemaFile * oldxsf = &c_schemaFile[SchemaRecord::OLD_SCHEMA_FILE];
+  const Uint32 noOfEntries = newxsf->noOfPages * NDB_SF_PAGE_ENTRIES;
+  for (Uint32 i = 0; i<noOfEntries; i++)
+  {
+    const SchemaFile::TableEntry * oldentry = getTableEntry(oldxsf, i);
+    const SchemaFile::TableEntry * newentry = getTableEntry(newxsf, i);
+    if (newentry->m_tableState == (Uint32)SchemaFile::SF_UNUSED)
+    {
+      jam();
+      if (oldentry->m_tableState == (Uint32)SchemaFile::SF_UNUSED)
       {
-        // minId is obsolete anyway
-        if (minId <= n * NDB_SF_PAGE_ENTRIES + i)
-        {
-          return n * NDB_SF_PAGE_ENTRIES + i;
-        }
+        jam();
+        return i;
       }
     }
   }
@@ -3480,9 +3487,14 @@ void Dbdict::checkSchemaStatus(Signal* s
 
       if (masterState != SchemaFile::SF_IN_USE)
       {
-        ownEntry->init();
+        if (ownEntry->m_tableType != DictTabInfo::SchemaTransaction)
+        {
+          jam();
+          ownEntry->init();
+        }
         continue;
       }
+
       /**
        * handle table(index) special as DIH has already copied
        *   table (using COPY_TABREQ)
@@ -4982,6 +4994,17 @@ Dbdict::execCREATE_TABLE_REQ(Signal* sig
   }
   SectionHandle handle(this, signal);
 
+  if (check_sender_version(signal, MAKE_VERSION(6,4,0)) < 0)
+  {
+    jam();
+    /**
+     * Pekka has for some obscure reason switched places of
+     *   senderRef/senderData
+     */
+    CreateTableReq* tmp = (CreateTableReq*)signal->getDataPtr();
+    do_swap(tmp->senderRef, tmp->senderData);
+  }
+
   const CreateTableReq req_copy =
     *(const CreateTableReq*)signal->getDataPtr();
   const CreateTableReq* req = &req_copy;
@@ -6465,6 +6488,17 @@ Dbdict::execDROP_TABLE_REQ(Signal* signa
   }
   SectionHandle handle(this, signal);
 
+  if (check_sender_version(signal, MAKE_VERSION(6,4,0)) < 0)
+  {
+    jam();
+    /**
+     * Pekka has for some obscure reason switched places of
+     *   senderRef/senderData
+     */
+    DropTableReq * tmp = (DropTableReq*)signal->getDataPtr();
+    do_swap(tmp->senderRef, tmp->senderData);
+  }
+
   const DropTableReq req_copy =
     *(const DropTableReq*)signal->getDataPtr();
   const DropTableReq* req = &req_copy;
@@ -7137,6 +7171,17 @@ Dbdict::check_ndb_versions() const
   return true;
 }
 
+int
+Dbdict::check_sender_version(const Signal* signal, Uint32 version) const
+{
+  Uint32 ver = getNodeInfo(refToNode(signal->getSendersBlockRef())).m_version;
+  if (ver < version)
+    return -1;
+  else if (ver > version)
+    return 1;
+  return 0;
+}
+
 void
 Dbdict::execALTER_TABLE_REQ(Signal* signal)
 {
@@ -7147,6 +7192,18 @@ Dbdict::execALTER_TABLE_REQ(Signal* sign
     return;
   }
   SectionHandle handle(this, signal);
+
+  if (check_sender_version(signal, MAKE_VERSION(6,4,0)) < 0)
+  {
+    jam();
+    /**
+     * Pekka has for some obscure reason switched places of
+     *   senderRef/senderData
+     */
+    AlterTableReq * tmp = (AlterTableReq*)signal->getDataPtr();
+    do_swap(tmp->clientRef, tmp->clientData);
+  }
+
   const AlterTableReq req_copy =
     *(const AlterTableReq*)signal->getDataPtr();
   const AlterTableReq* req = &req_copy;
@@ -9835,6 +9892,17 @@ Dbdict::execCREATE_INDX_REQ(Signal* sign
   }
   SectionHandle handle(this, signal);
 
+  if (check_sender_version(signal, MAKE_VERSION(6,4,0)) < 0)
+  {
+    jam();
+    /**
+     * Pekka has for some obscure reason switched places of
+     *   senderRef/senderData
+     */
+    CreateIndxReq * tmp = (CreateIndxReq*)signal->getDataPtr();
+    do_swap(tmp->clientRef, tmp->clientData);
+  }
+
   const CreateIndxReq req_copy =
     *(const CreateIndxReq*)signal->getDataPtr();
   const CreateIndxReq* req = &req_copy;
@@ -10544,6 +10612,17 @@ Dbdict::execDROP_INDX_REQ(Signal* signal
   }
   SectionHandle handle(this, signal);
 
+  if (check_sender_version(signal, MAKE_VERSION(6,4,0)) < 0)
+  {
+    jam();
+    /**
+     * Pekka has for some obscure reason switched places of
+     *   senderRef/senderData
+     */
+    DropIndxReq * tmp = (DropIndxReq*)signal->getDataPtr();
+    do_swap(tmp->clientRef, tmp->clientData);
+  }
+
   const DropIndxReq req_copy =
     *(const DropIndxReq*)signal->getDataPtr();
   const DropIndxReq* req = &req_copy;
@@ -18377,6 +18456,17 @@ Dbdict::getTableEntry(XSchemaFile * xsf,
   return &sf->TableEntries[i];
 }
 
+const SchemaFile::TableEntry *
+Dbdict::getTableEntry(const XSchemaFile * xsf, Uint32 tableId)
+{
+  Uint32 n = tableId / NDB_SF_PAGE_ENTRIES;
+  Uint32 i = tableId % NDB_SF_PAGE_ENTRIES;
+  ndbrequire(n < xsf->noOfPages);
+
+  SchemaFile * sf = &xsf->schemaPage[n];
+  return &sf->TableEntries[i];
+}
+
 //******************************************
 
 // MODULE: CreateFile
@@ -22247,7 +22337,7 @@ Dbdict::execSCHEMA_TRANS_BEGIN_REQ(Signa
       break;
     }
 
-    if (!check_ndb_versions())
+    if (!check_ndb_versions() && !localTrans)
     {
       jam();
       setError(error, SchemaTransBeginRef::IncompatibleVersions, __LINE__);

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2008-12-12 14:30:54 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2009-04-15 14:08:26 +0000
@@ -852,6 +852,8 @@ private:
   void execALTER_TABLE_REF(Signal* signal);
   void execALTER_TABLE_CONF(Signal* signal);
   bool check_ndb_versions() const;
+  int check_sender_version(const Signal* signal, Uint32 version) const;
+
 
   void execCREATE_FILE_REQ(Signal* signal);
   void execCREATE_FILEGROUP_REQ(Signal* signal);
@@ -1110,6 +1112,7 @@ private:
   bool validateChecksum(const XSchemaFile *);
   SchemaFile::TableEntry * getTableEntry(Uint32 tableId);
   SchemaFile::TableEntry * getTableEntry(XSchemaFile *, Uint32 tableId);
+  const SchemaFile::TableEntry * getTableEntry(const XSchemaFile*, Uint32);
 
   Uint32 computeChecksum(const Uint32 * src, Uint32 len);
 

=== modified file 'storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp'
--- a/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2009-04-05 21:03:06 +0000
+++ b/storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp	2009-04-16 09:11:14 +0000
@@ -3144,7 +3144,7 @@ void Qmgr::execAPI_REGREQ(Signal* signal
                                   buf, 
                                   sizeof(buf)),
 	      NDB_VERSION_STRING,
-              extra ? extra : 0);
+              extra ? extra : "");
     apiNodePtr.p->phase = ZAPI_INACTIVE;
     sendApiRegRef(signal, ref, ApiRegRef::UnsupportedVersion);
     return;

=== modified file 'storage/ndb/src/mgmsrv/ConfigManager.cpp'
--- a/storage/ndb/src/mgmsrv/ConfigManager.cpp	2009-03-26 09:15:15 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.cpp	2009-04-16 08:12:24 +0000
@@ -1331,6 +1331,7 @@ ConfigManager::execCONFIG_CHECK_REQ(Sign
                        nodeId, generation, other_generation,
                        m_config_state, other_state);
 
+
   switch (m_config_state)
   {
   default:
@@ -1342,8 +1343,14 @@ ConfigManager::execCONFIG_CHECK_REQ(Sign
   case CS_INITIAL:
     if (other_state != CS_INITIAL)
     {
-      g_eventLogger->error("Other node are not in INITIAL");
-      exit(1);
+      g_eventLogger->warning("Refusing CONGIG_CHECK_REQ from %u, "
+                             "  it's not CS_INITIAL (I am). "
+                             " Waiting for my check",
+                             nodeId);
+      sendConfigCheckRef(ss, from, ConfigCheckRef::WrongState,
+                         generation, other_generation,
+                         m_config_state, other_state);
+      return;
     }
 
     require(generation == 0);
@@ -1445,7 +1452,7 @@ ConfigManager::sendConfigCheckRef(Signal
                        error, nodeId);
 
   ss.sendSignal(nodeId, ssig, MGM_CONFIG_MAN,
-                GSN_CONFIG_CHECK_REF, ConfigCheckReq::SignalLength);
+                GSN_CONFIG_CHECK_REF, ConfigCheckRef::SignalLength);
 }
 
 
@@ -1462,7 +1469,7 @@ ConfigManager::sendConfigCheckConf(Signa
   g_eventLogger->debug("Send CONFIG_CHECK_CONF to node: %d", nodeId);
 
   ss.sendSignal(nodeId, ssig, MGM_CONFIG_MAN,
-                GSN_CONFIG_CHECK_CONF, ConfigCheckReq::SignalLength);
+                GSN_CONFIG_CHECK_CONF, ConfigCheckConf::SignalLength);
 }
 
 
@@ -1490,14 +1497,30 @@ ConfigManager::execCONFIG_CHECK_REF(Sign
   const ConfigCheckRef* const ref =
     CAST_CONSTPTR(ConfigCheckRef, sig->getDataPtr());
 
-  g_eventLogger->error("Got CONFIG_CHECK_REF from node %d, "   \
-                       "error: %d, message: '%s'\n"            \
-                       "generation: %d, expected generation: %d\n"\
-                       "state: %d, expected state: %d",
-                       nodeId, ref->error,
-                       ConfigCheckRef::errorMessage(ref->error),
-                       ref->generation, ref->expected_generation,
-                       ref->state, ref->expected_state);
+  g_eventLogger->info("Got CONFIG_CHECK_REF from node %d, "
+                      "error: %d, message: '%s'\n"
+                      "generation: %d, expected generation: %d\n"
+                      "state: %d, expected state: %d own-state: %u",
+                      nodeId, ref->error,
+                      ConfigCheckRef::errorMessage(ref->error),
+                      ref->generation, ref->expected_generation,
+                      ref->state, ref->expected_state,
+                      m_config_state);
+  
+  if (m_config_state != CS_INITIAL &&
+      ref->expected_state == CS_INITIAL)
+  {
+    g_eventLogger->info("Waiting for peer");
+    return;
+  }
+
+  if (m_config_state == CS_INITIAL)
+  {
+    g_eventLogger->info("Waiting");
+    return;
+  }
+  
+  g_eventLogger->error("Terminating");
   exit(1);
 }
 

=== modified file 'storage/ndb/src/mgmsrv/ConfigManager.hpp'
--- a/storage/ndb/src/mgmsrv/ConfigManager.hpp	2009-03-26 09:11:40 +0000
+++ b/storage/ndb/src/mgmsrv/ConfigManager.hpp	2009-04-15 14:45:05 +0000
@@ -41,11 +41,11 @@ class ConfigManager : public MgmtThread 
 
   struct ConfigChangeState {
     enum States {
-      IDLE,
-      PREPARING,
-      COMITTING,
-      ABORT,
-      ABORTING
+      IDLE = 0,
+      PREPARING = 1,
+      COMITTING = 2,
+      ABORT = 3,
+      ABORTING = 4
     } m_current_state;
 
     ConfigChangeState() :
@@ -57,12 +57,12 @@ class ConfigManager : public MgmtThread 
   void set_config_change_state(ConfigChangeState::States state);
 
   enum ConfigState {
-    CS_UNINITIALIZED,
+    CS_UNINITIALIZED = 0,
 
-    CS_INITIAL,      // Initial config.ini, ie. no config.bin.X found
+    CS_INITIAL = 1,   // Initial config.ini, ie. no config.bin.X found
 
-    CS_CONFIRMED,    // Started and all agreed
-    CS_FORCED        // Forced start
+    CS_CONFIRMED = 2, // Started and all agreed
+    CS_FORCED = 3     // Forced start
   };
 
   ConfigState m_config_state;

=== modified file 'storage/ndb/test/ndbapi/testUpgrade.cpp'
--- a/storage/ndb/test/ndbapi/testUpgrade.cpp	2008-12-12 14:44:00 +0000
+++ b/storage/ndb/test/ndbapi/testUpgrade.cpp	2009-04-15 12:50:50 +0000
@@ -21,6 +21,12 @@
 #include <AtrtClient.hpp>
 #include <Bitmask.hpp>
 
+struct NodeInfo
+{
+  int nodeId;
+  int processId;
+  int nodeGroup;
+};
 
 /**
   Test that one node at a time can be upgraded
@@ -151,21 +157,31 @@ int runUpgrade_NR2(NDBT_Context* ctx, ND
     if (!atrt.getNdbds(clusterId, ndbds))
       return NDBT_FAILED;
 
+    Vector<NodeInfo> nodes;
+    while (ndbds.next())
+    {
+      struct NodeInfo n;
+      n.nodeId = ndbds.columnAsInt("node_id");
+      n.processId = ndbds.columnAsInt("id");
+      n.nodeGroup = restarter.getNodeGroup(n.nodeId);
+      nodes.push_back(n);
+    }
+
     Bitmask<4> seen_groups;
-    while(ndbds.next())
+    Bitmask<4> restarted_nodes;
+    for (Uint32 i = 0; i<nodes.size(); i++)
     {
-      int nodeId = ndbds.columnAsInt("node_id");
-      int processId = ndbds.columnAsInt("id");
-      int nodeGroup= restarter.getNodeGroup(nodeId);
+      int nodeId = nodes[i].nodeId;
+      int processId = nodes[i].processId;
+      int nodeGroup= nodes[i].nodeGroup;
 
-      if (seen_groups.get(nodeGroup)){
+      if (seen_groups.get(nodeGroup))
+      {
         // One node in this node group already down
         continue;
       }
       seen_groups.set(nodeGroup);
-
-      // Remove row from resultset
-      ndbds.remove();
+      restarted_nodes.set(nodeId);
 
       ndbout << "Restart node " << nodeId << endl;
 
@@ -185,21 +201,22 @@ int runUpgrade_NR2(NDBT_Context* ctx, ND
       return NDBT_FAILED;
 
     // Restart the remaining nodes
-    ndbds.reset();
-    while(ndbds.next())
+    for (Uint32 i = 0; i<nodes.size(); i++)
     {
-      int nodeId = ndbds.columnAsInt("node_id");
-      int processId = ndbds.columnAsInt("id");
-
+      int nodeId = nodes[i].nodeId;
+      if (restarted_nodes.get(nodeId))
+        continue;
+      
+      int processId = nodes[i].processId;
       ndbout << "Restart node " << nodeId << endl;
       if (!atrt.changeVersion(processId, ""))
         return NDBT_FAILED;
-
+      
       if (restarter.waitNodesNoStart(&nodeId, 1))
         return NDBT_FAILED;
-
+      
     }
-
+    
     ndbout << "Starting and wait for started..." << endl;
     if (restarter.startAll())
       return NDBT_FAILED;
@@ -266,36 +283,46 @@ int runUpgrade_NR3(NDBT_Context* ctx, ND
     if (!atrt.getNdbds(clusterId, ndbds))
       return NDBT_FAILED;
 
-    int nodes[256];
+    Vector<NodeInfo> nodes;
+    while (ndbds.next())
+    {
+      struct NodeInfo n;
+      n.nodeId = ndbds.columnAsInt("node_id");
+      n.processId = ndbds.columnAsInt("id");
+      n.nodeGroup = restarter.getNodeGroup(n.nodeId);
+      nodes.push_back(n);
+    }
+
+    int nodesarray[256];
     int cnt= 0;
 
     Bitmask<4> seen_groups;
-    while(ndbds.next())
+    Bitmask<4> restarted_nodes;
+    for (Uint32 i = 0; i<nodes.size(); i++)
     {
-      int nodeId = ndbds.columnAsInt("node_id");
-      int processId = ndbds.columnAsInt("id");
-      int nodeGroup= restarter.getNodeGroup(nodeId);
+      int nodeId = nodes[i].nodeId;
+      int processId = nodes[i].processId;
+      int nodeGroup= nodes[i].nodeGroup;
 
-      if (seen_groups.get(nodeGroup)){
+      if (seen_groups.get(nodeGroup))
+      {
         // One node in this node group already down
         continue;
       }
       seen_groups.set(nodeGroup);
-
-      // Remove row from resultset
-      ndbds.remove();
+      restarted_nodes.set(nodeId);
 
       ndbout << "Restart node " << nodeId << endl;
-
+      
       if (!atrt.changeVersion(processId, ""))
         return NDBT_FAILED;
-
-      nodes[cnt++]= nodeId;
+      
+      nodesarray[cnt++]= nodeId;
     }
-
-    if (restarter.waitNodesNoStart(nodes, cnt))
+    
+    if (restarter.waitNodesNoStart(nodesarray, cnt))
       return NDBT_FAILED;
-
+    
     ndbout << "Starting and wait for started..." << endl;
     if (restarter.startAll())
       return NDBT_FAILED;
@@ -305,32 +332,31 @@ int runUpgrade_NR3(NDBT_Context* ctx, ND
 
     // Restart the remaining nodes
     cnt= 0;
-    ndbds.reset();
-    while(ndbds.next())
+    for (Uint32 i = 0; i<nodes.size(); i++)
     {
-      int nodeId = ndbds.columnAsInt("node_id");
-      int processId = ndbds.columnAsInt("id");
+      int nodeId = nodes[i].nodeId;
+      int processId = nodes[i].processId;
 
+      if (restarted_nodes.get(nodeId))
+        continue;
+      
       ndbout << "Restart node " << nodeId << endl;
       if (!atrt.changeVersion(processId, ""))
         return NDBT_FAILED;
 
-
-      nodes[cnt++]= nodeId;
-
+      nodesarray[cnt++]= nodeId;
     }
-
-    if (restarter.waitNodesNoStart(nodes, cnt))
+    
+    if (restarter.waitNodesNoStart(nodesarray, cnt))
       return NDBT_FAILED;
-
-
+    
+    
     ndbout << "Starting and wait for started..." << endl;
     if (restarter.startAll())
       return NDBT_FAILED;
-
+    
     if (restarter.waitClusterStarted())
       return NDBT_FAILED;
-
   }
 
   ctx->stopTest();
@@ -396,3 +422,4 @@ int main(int argc, const char** argv){
   return testUpgrade.execute(argc, argv);
 }
 
+template class Vector<NodeInfo>;

=== modified file 'vio/viossl.c'
--- a/vio/viossl.c	2008-08-21 06:32:09 +0000
+++ b/vio/viossl.c	2009-04-15 15:10:00 +0000
@@ -201,7 +201,7 @@ static int ssl_do(struct st_VioSSLFd *pt
   DBUG_PRINT("info", ("ssl: 0x%lx timeout: %ld", (long) ssl, timeout));
   SSL_clear(ssl);
   SSL_SESSION_set_timeout(SSL_get_session(ssl), timeout);
-  SSL_set_fd(ssl, vio->sd);
+  SSL_set_fd(ssl, my_socket_get_fd(vio->sd));
 
   if (connect_accept_func(ssl) < 1)
   {
@@ -217,7 +217,7 @@ static int ssl_do(struct st_VioSSLFd *pt
     change type, set sd to the fd used when connecting
     and set pointer to the SSL structure
   */
-  vio_reset(vio, VIO_TYPE_SSL, SSL_get_fd(ssl), 0, 0);
+  vio_reset(vio, VIO_TYPE_SSL, vio->sd, 0, 0);
   vio->ssl_arg= (void*)ssl;
 
 #ifndef DBUG_OFF


Attachment: [text/bzr-bundle] bzr/jack@sun.com-20090416111503-00o2025g2cav4s78.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jack:2870)jack andrews16 Apr