List:Commits« Previous MessageNext Message »
From:jonas oreland Date:February 18 2011 8:51am
Subject:bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3438 to
3439)
View as plain text  
 3439 jonas oreland	2011-02-18 [merge]
      ndb spj - merge 70-main

    modified:
      storage/ndb/include/kernel/signaldata/DictTabInfo.hpp
      storage/ndb/include/ndb_constants.h
      storage/ndb/include/ndbapi/NdbDictionary.hpp
      storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/lgman.cpp
      storage/ndb/src/ndbapi/NdbDictionary.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp
      storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp
 3438 jonas oreland	2011-02-16 [merge]
      ndb spj - merge 70-main

    modified:
      mysql-test/include/default_ndbd.cnf
      sql/ha_ndbcluster.cc
      sql/ha_ndbcluster.h
      sql/ha_ndbcluster_binlog.cc
      sql/ha_ndbcluster_binlog.h
      storage/ndb/include/kernel/signaldata/CopyFrag.hpp
      storage/ndb/include/kernel/signaldata/CreateTab.hpp
      storage/ndb/include/kernel/signaldata/StartFragReq.hpp
      storage/ndb/include/mgmapi/mgmapi_config_parameters.h
      storage/ndb/include/ndb_version.h.in
      storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
      storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
      storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
      storage/ndb/src/mgmsrv/ConfigInfo.cpp
      storage/ndb/test/run-test/conf-dl145a.cnf
      storage/ndb/test/run-test/conf-ndb07.cnf
=== modified file 'storage/ndb/include/kernel/signaldata/DictTabInfo.hpp'
--- a/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/kernel/signaldata/DictTabInfo.hpp	2011-02-16 14:53:53 +0000
@@ -148,6 +148,8 @@ public:
     HashMapObjectId    = 153,
     HashMapVersion     = 154,
 
+    TableStorageType   = 155,
+
     TableEnd           = 999,
     
     AttributeName          = 1000, // String, Mandatory
@@ -376,7 +378,9 @@ public:
 
     Uint32 HashMapObjectId;
     Uint32 HashMapVersion;
-    
+
+    Uint32 TableStorageType;
+
     Table() {}
     void init();
   };

=== modified file 'storage/ndb/include/ndb_constants.h'
--- a/storage/ndb/include/ndb_constants.h	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/include/ndb_constants.h	2011-02-16 14:53:53 +0000
@@ -87,6 +87,7 @@
 
 #define NDB_STORAGETYPE_MEMORY          0
 #define NDB_STORAGETYPE_DISK            1
+#define NDB_STORAGETYPE_DEFAULT         2 /* not set */
 
 /*
  * Table temporary status.

=== modified file 'storage/ndb/include/ndbapi/NdbDictionary.hpp'
--- a/storage/ndb/include/ndbapi/NdbDictionary.hpp	2011-02-09 14:59:39 +0000
+++ b/storage/ndb/include/ndbapi/NdbDictionary.hpp	2011-02-18 08:50:50 +0000
@@ -287,7 +287,8 @@ public:
      */
     enum StorageType {
       StorageTypeMemory = NDB_STORAGETYPE_MEMORY,
-      StorageTypeDisk = NDB_STORAGETYPE_DISK
+      StorageTypeDisk = NDB_STORAGETYPE_DISK,
+      StorageTypeDefault = NDB_STORAGETYPE_DEFAULT
     };
 
     /** 
@@ -1054,6 +1055,12 @@ public:
      *   this as way way too much stuff is pushed into NdbDictInterface
      */
     void assignObjId(const ObjectId &);
+
+    /**
+     * set/get table-storage-method
+     */
+    void setStorageType(Column::StorageType);
+    Column::StorageType getStorageType() const;
 #endif
 
     // these 2 are not de-doxygenated

=== modified file 'storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/DictTabInfo.cpp	2011-02-16 14:53:53 +0000
@@ -72,6 +72,7 @@ DictTabInfo::TableMapping[] = {
   DTIMAP(Table, SingleUserMode, SingleUserMode),
   DTIMAP(Table, HashMapObjectId, HashMapObjectId),
   DTIMAP(Table, HashMapVersion, HashMapVersion),
+  DTIMAP(Table, TableStorageType, TableStorageType),
   DTIBREAK(AttributeName)
 };
 
@@ -181,6 +182,8 @@ DictTabInfo::Table::init(){
 
   HashMapObjectId = RNIL;
   HashMapVersion = RNIL;
+
+  TableStorageType = NDB_STORAGETYPE_DEFAULT;
 }
 
 void

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-16 12:28:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp	2011-02-18 08:50:50 +0000
@@ -744,6 +744,7 @@ Dbdict::packTableIntoPages(SimplePropert
   w.add(DictTabInfo::MinRowsHigh, tablePtr.p->minRowsHigh);
   w.add(DictTabInfo::SingleUserMode, tablePtr.p->singleUserMode);
   w.add(DictTabInfo::HashMapObjectId, tablePtr.p->hashMapObjectId);
+  w.add(DictTabInfo::TableStorageType, tablePtr.p->storageType);
 
   if (tablePtr.p->hashMapObjectId != RNIL)
   {
@@ -2452,6 +2453,7 @@ void Dbdict::initialiseTableRecord(Table
   tablePtr.p->triggerId = RNIL;
   tablePtr.p->buildTriggerId = RNIL;
   tablePtr.p->m_read_locked= 0;
+  tablePtr.p->storageType = NDB_STORAGETYPE_DEFAULT;
 }//Dbdict::initialiseTableRecord()
 
 void Dbdict::initTriggerRecords()
@@ -4941,6 +4943,7 @@ void Dbdict::handleTabInfoInit(Signal * 
   tablePtr.p->singleUserMode = c_tableDesc.SingleUserMode;
   tablePtr.p->hashMapObjectId = c_tableDesc.HashMapObjectId;
   tablePtr.p->hashMapVersion = c_tableDesc.HashMapVersion;
+  tablePtr.p->storageType = c_tableDesc.TableStorageType;
 
   tabRequire(tablePtr.p->noOfAttributes <= MAX_ATTRIBUTES_IN_TABLE,
              CreateTableRef::NoMoreAttributeRecords); // bad error code!

=== modified file 'storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2011-02-01 23:27:25 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp	2011-02-16 14:53:53 +0000
@@ -330,6 +330,11 @@ public:
      */
     Uint8 minLoadFactor;
 
+    /**
+     * Table default storage method
+     */
+    Uint8 storageType; // NDB_STORAGETYPE_
+
     /* Convenience routines */
     bool isTable() const;
     bool isIndex() const;

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-16 12:28:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-02-18 08:50:50 +0000
@@ -1989,6 +1989,7 @@ void Dbdih::execREAD_NODESCONF(Signal* s
   if (c_2pass_inr)
   {
     jam();
+    Uint32 workers = getNodeInfo(getOwnNodeId()).m_lqh_workers;
     printf("Checking 2-pass initial node restart: ");
     for (i = 0; i<index; i++)
     {
@@ -1996,7 +1997,16 @@ void Dbdih::execREAD_NODESCONF(Signal* s
       {
         jam();
         c_2pass_inr = false;
-        printf("not ok (node %u) => disabled\n", nodeArray[i]);
+        printf("not ok (version node %u) => disabled\n", nodeArray[i]);
+        break;
+      }
+
+      if (workers > 1 &&
+          workers != getNodeInfo(nodeArray[i]).m_lqh_workers)
+      {
+        c_2pass_inr = false;
+        printf("not ok (different worker cnt node %u) => disabled\n", 
+               nodeArray[i]);
         break;
       }
     }
@@ -3779,7 +3789,7 @@ done:
     req->fragId = takeOverPtr.p->toCurrentFragid;
     req->noOfLogNodes = 0;
 
-    if (c_2pass_inr)
+    if (c_2pass_inr && cstarttype == NodeState::ST_INITIAL_NODE_RESTART)
     {
       /**
        * Check if we can make 2-phase copy
@@ -3830,7 +3840,7 @@ done:
                takeOverPtr.p->toCurrentTabref,
                takeOverPtr.p->toCurrentFragid,
                req->lqhLogNode[0],
-               req->lcpId);
+               takeOverPtr.p->startGci);
     }
 
     BlockReference ref = numberToRef(DBLQH, takeOverPtr.p->toStartingNode);

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-16 12:28:43 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp	2011-02-18 08:50:50 +0000
@@ -73,6 +73,7 @@
 #include <signaldata/SignalDroppedRep.hpp>
 #include <signaldata/FsReadWriteReq.hpp>
 #include <signaldata/DbinfoScan.hpp>
+#include <signaldata/SystemError.hpp>
 #include <NdbEnv.h>
 
 #include "../suma/Suma.hpp"
@@ -7841,12 +7842,6 @@ void Dblqh::commitContinueAfterBlockedLa
       EXECUTE_DIRECT(tup, GSN_TUP_COMMITREQ, signal, 
 		     TupCommitReq::SignalLength);
 
-      if(signal->theData[0] != 0)
-      {
-	regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
-	return; // TUP_COMMIT was timesliced
-      }
-      
       if (TRACENR_FLAG)
       {
 	TRACENR("COMMIT: ");
@@ -7867,9 +7862,18 @@ void Dblqh::commitContinueAfterBlockedLa
 	if (LqhKeyReq::getRowidFlag(regTcPtr.p->reqinfo))
 	  TRACENR(" rowid: " << regTcPtr.p->m_row_id);
 	TRACENR(" key: " << getKeyInfoWordOrZero(regTcPtr.p, 0));
+
+        if (signal->theData[0] != 0)
+          TRACENR(" TIMESLICE");
 	TRACENR(endl);
       }
 
+      if(signal->theData[0] != 0)
+      {
+        regTcPtr.p->transactionState = TcConnectionrec::WAIT_TUP_COMMIT;
+        return; // TUP_COMMIT was timesliced
+      }
+
       TRACE_OP(regTcPtr.p, "ACC_COMMITREQ");
 
       Uint32 acc = refToMain(regTcPtr.p->tcAccBlockref);
@@ -16558,7 +16562,6 @@ Dblqh::send_restore_lcp(Signal * signal)
 
     sendSignal(ref, GSN_COPY_FRAGREQ, signal,
                CopyFragReq::SignalLength, JBB);
-
   }
 }
 
@@ -16566,7 +16569,17 @@ void
 Dblqh::execCOPY_FRAGREF(Signal* signal)
 {
   jamEntry();
-  ndbrequire(false);
+
+  const CopyFragRef * ref = CAST_CONSTPTR(CopyFragRef, signal->getDataPtr());
+  Uint32 errorCode = ref->errorCode;
+
+  SystemError * sysErr = (SystemError*)&signal->theData[0];
+  sysErr->errorCode = SystemError::CopyFragRefError;
+  sysErr->errorRef = reference();
+  sysErr->data[0] = errorCode;
+  sysErr->data[1] = 0;
+  sendSignal(NDBCNTR_REF, GSN_SYSTEM_ERROR, signal,
+             SystemError::SignalLength, JBB);
 }
 
 void
@@ -16663,7 +16676,18 @@ void Dblqh::execRESTORE_LCP_CONF(Signal*
     lcpPtr.i = 0;
     ptrAss(lcpPtr, lcpRecord);
     lcpPtr.p->m_outstanding = 1;
-    
+
+    if (cstartType == NodeState::ST_INITIAL_NODE_RESTART)
+    {
+      jam();
+      /**
+       * Skip lgman undo...
+       */
+      signal->theData[0] = LGMAN_REF;
+      sendSignal(reference(), GSN_START_RECCONF, signal, 1, JBB);
+      return;
+    }
+
     if (!isNdbMtLqh())
     {
       jam();

=== modified file 'storage/ndb/src/kernel/blocks/lgman.cpp'
--- a/storage/ndb/src/kernel/blocks/lgman.cpp	2011-02-15 08:46:20 +0000
+++ b/storage/ndb/src/kernel/blocks/lgman.cpp	2011-02-17 15:51:08 +0000
@@ -595,7 +595,9 @@ Lgman::execCREATE_FILEGROUP_IMPL_REQ(Sig
     m_logfile_group_hash.add(ptr);
     m_logfile_group_list.add(ptr);
 
-    if (getNodeState().getNodeRestartInProgress() ||
+    if ((getNodeState().getNodeRestartInProgress() &&
+         getNodeState().starting.restartType !=
+         NodeState::ST_INITIAL_NODE_RESTART)||
         getNodeState().getSystemRestartInProgress())
     {
       ptr.p->m_state = Logfile_group::LG_STARTING;

=== modified file 'storage/ndb/src/ndbapi/NdbDictionary.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionary.cpp	2011-02-09 14:59:39 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionary.cpp	2011-02-18 08:50:50 +0000
@@ -1003,6 +1003,18 @@ NdbDictionary::Table::assignObjId(const 
   m_impl.m_version = objId.m_version;
 }
 
+void
+NdbDictionary::Table::setStorageType(NdbDictionary::Column::StorageType type)
+{
+  m_impl.m_storageType = type;
+}
+
+NdbDictionary::Column::StorageType
+NdbDictionary::Table::getStorageType() const
+{
+  return (NdbDictionary::Column::StorageType)m_impl.m_storageType;
+}
+
 /*****************************************************************
  * Index facade
  */

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2011-02-04 17:52:38 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp	2011-02-16 15:39:36 +0000
@@ -637,6 +637,7 @@ NdbTableImpl::init(){
   m_single_user_mode = 0;
   m_hash_map_id = RNIL;
   m_hash_map_version = ~0;
+  m_storageType = NDB_STORAGETYPE_DEFAULT;
 }
 
 bool
@@ -921,6 +922,8 @@ NdbTableImpl::assign(const NdbTableImpl&
   m_tablespace_name = org.m_tablespace_name;
   m_tablespace_id= org.m_tablespace_id;
   m_tablespace_version = org.m_tablespace_version;
+  m_storageType = org.m_storageType;
+
   DBUG_RETURN(0);
 }
 
@@ -2681,6 +2684,7 @@ NdbDictInterface::parseTableInfo(NdbTabl
   impl->m_minLoadFactor = tableDesc->MinLoadFactor;
   impl->m_maxLoadFactor = tableDesc->MaxLoadFactor;
   impl->m_single_user_mode = tableDesc->SingleUserMode;
+  impl->m_storageType = tableDesc->TableStorageType;
 
   impl->m_indexType = (NdbDictionary::Object::Type)
     getApiConstant(tableDesc->TableType,
@@ -3393,6 +3397,7 @@ NdbDictInterface::serializeTableDesc(Ndb
 
   tmpTab->HashMapObjectId = impl.m_hash_map_id;
   tmpTab->HashMapVersion = impl.m_hash_map_version;
+  tmpTab->TableStorageType = impl.m_storageType;
 
   const char *tablespace_name= impl.m_tablespace_name.c_str();
 loop:

=== modified file 'storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp'
--- a/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2011-02-03 14:20:36 +0000
+++ b/storage/ndb/src/ndbapi/NdbDictionaryImpl.hpp	2011-02-16 14:53:53 +0000
@@ -233,6 +233,7 @@ public:
   Uint16 m_keyLenInWords;
   Uint16 m_fragmentCount;
   Uint8 m_single_user_mode;
+  Uint8 m_storageType;  // NDB_STORAGETYPE_MEMORY or _DISK or DEFAULT
 
   NdbIndexImpl * m_index;
   NdbColumnImpl * getColumn(unsigned attrId);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.1-telco-7.0-spj-scan-vs-scan branch (jonas:3438 to3439) jonas oreland18 Feb