List:Commits« Previous MessageNext Message »
From:Pekka Nousiainen Date:July 26 2008 5:13am
Subject:bzr commit into mysql-5.1-telco-6.4 branch (pekka:2683) WL#4391
View as plain text  
#At file:///export/space/pekka/ndb/version/my51-wl4391/

 2683 Pekka Nousiainen	2008-07-26
      wl#4391 02.diff
      LocalProxy, including READ_CONFIG, and subclasses.
added:
  storage/ndb/src/kernel/blocks/LocalProxy.cpp
  storage/ndb/src/kernel/blocks/LocalProxy.hpp
  storage/ndb/src/kernel/blocks/RestoreProxy.cpp
  storage/ndb/src/kernel/blocks/RestoreProxy.hpp
  storage/ndb/src/kernel/blocks/backup/BackupProxy.cpp
  storage/ndb/src/kernel/blocks/backup/BackupProxy.hpp
  storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.cpp
  storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.hpp
  storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp
  storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.hpp
  storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp
  storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp
  storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp
  storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp
modified:
  storage/ndb/src/kernel/SimBlockList.cpp
  storage/ndb/src/kernel/blocks/Makefile.am
  storage/ndb/src/kernel/blocks/backup/Backup.hpp
  storage/ndb/src/kernel/blocks/backup/BackupInit.cpp
  storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp
  storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp
  storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp
  storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp
  storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp
  storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp
  storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp
  storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp
  storage/ndb/src/kernel/blocks/restore.cpp
  storage/ndb/src/kernel/blocks/restore.hpp

=== modified file 'storage/ndb/src/kernel/SimBlockList.cpp'
--- a/storage/ndb/src/kernel/SimBlockList.cpp	2006-12-23 19:20:40 +0000
+++ b/storage/ndb/src/kernel/SimBlockList.cpp	2008-07-26 05:13:40 +0000
@@ -36,6 +36,13 @@
 #include <pgman.hpp>
 #include <restore.hpp>
 #include <NdbEnv.h>
+#include <LocalProxy.hpp>
+#include <DblqhProxy.hpp>
+#include <DbaccProxy.hpp>
+#include <DbtupProxy.hpp>
+#include <DbtuxProxy.hpp>
+#include <BackupProxy.hpp>
+#include <RestoreProxy.hpp>
 
 #ifndef VM_TRACE
 #define NEW_BLOCK(B) new B
@@ -68,6 +75,9 @@ void * operator new (size_t sz, SIMBLOCK
 #define NEW_BLOCK(B) new(A_VALUE) B
 #endif
 
+extern bool g_ndbMt;
+extern bool g_ndbMtLqh;
+
 void 
 SimBlockList::load(EmulatorData& data){
   noOfBlocks = NO_OF_BLOCKS;
@@ -91,26 +101,44 @@ SimBlockList::load(EmulatorData& data){
       fs = NEW_BLOCK(Ndbfs)(ctx);
     }
   }
-  
+
   theList[0]  = pg = NEW_BLOCK(Pgman)(ctx);
   theList[1]  = lg = NEW_BLOCK(Lgman)(ctx);
   theList[2]  = ts = NEW_BLOCK(Tsman)(ctx, pg, lg);
-  theList[3]  = NEW_BLOCK(Dbacc)(ctx);
+  if (!g_ndbMtLqh)
+    theList[3]  = NEW_BLOCK(Dbacc)(ctx);
+  else
+    theList[3]  = NEW_BLOCK(DbaccProxy)(ctx);
   theList[4]  = NEW_BLOCK(Cmvmi)(ctx);
   theList[5]  = fs;
   theList[6]  = dbdict = NEW_BLOCK(Dbdict)(ctx);
   theList[7]  = dbdih = NEW_BLOCK(Dbdih)(ctx);
-  theList[8]  = NEW_BLOCK(Dblqh)(ctx);
+  if (!g_ndbMtLqh)
+    theList[8]  = NEW_BLOCK(Dblqh)(ctx);
+  else
+    theList[8]  = NEW_BLOCK(DblqhProxy)(ctx);
   theList[9]  = NEW_BLOCK(Dbtc)(ctx);
-  theList[10] = NEW_BLOCK(Dbtup)(ctx, pg);
+  if (!g_ndbMtLqh)
+    theList[10] = NEW_BLOCK(Dbtup)(ctx, pg);
+  else
+    theList[10] = NEW_BLOCK(DbtupProxy)(ctx);//wl4391_todo pg
   theList[11] = NEW_BLOCK(Ndbcntr)(ctx);
   theList[12] = NEW_BLOCK(Qmgr)(ctx);
   theList[13] = NEW_BLOCK(Trix)(ctx);
-  theList[14] = NEW_BLOCK(Backup)(ctx);
+  if (!g_ndbMtLqh)
+    theList[14] = NEW_BLOCK(Backup)(ctx);
+  else
+    theList[14] = NEW_BLOCK(BackupProxy)(ctx);
   theList[15] = NEW_BLOCK(DbUtil)(ctx);
   theList[16] = NEW_BLOCK(Suma)(ctx);
-  theList[17] = NEW_BLOCK(Dbtux)(ctx);
-  theList[18] = NEW_BLOCK(Restore)(ctx);
+  if (!g_ndbMtLqh)
+    theList[17] = NEW_BLOCK(Dbtux)(ctx);
+  else
+    theList[17] = NEW_BLOCK(DbtuxProxy)(ctx);
+  if (!g_ndbMtLqh)
+    theList[18] = NEW_BLOCK(Restore)(ctx);
+  else
+    theList[18] = NEW_BLOCK(RestoreProxy)(ctx);
   assert(NO_OF_BLOCKS == 19);
 }
 

=== added file 'storage/ndb/src/kernel/blocks/LocalProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,121 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include <mt.hpp>
+#include "LocalProxy.hpp"
+
+LocalProxy::LocalProxy(BlockNumber blockNumber, Block_context& ctx) :
+  SimulatedBlock(blockNumber, ctx)
+{
+  BLOCK_CONSTRUCTOR(LocalProxy);
+
+  ndbrequire(instance() == 0); // this is main block
+  c_workers = 0;
+  c_threads = 0;
+  Uint32 i;
+  for (i = 0; i < MaxWorkers; i++)
+    c_worker[i] = 0;
+
+  // GSN_READ_CONFIG_REQ
+  addRecSignal(GSN_READ_CONFIG_REQ, &LocalProxy::execREAD_CONFIG_REQ, true);
+  addRecSignal(GSN_READ_CONFIG_CONF, &LocalProxy::execREAD_CONFIG_CONF, true);
+}
+
+LocalProxy::~LocalProxy()
+{
+  // dtor of main block deletes workers
+}
+
+// GSN_READ_CONFIG_REQ
+
+void
+LocalProxy::execREAD_CONFIG_REQ(Signal* signal)
+{
+  Ss_READ_CONFIG_REQ& ss = c_ss_READ_CONFIG_REQ;
+  ndbrequire(!ss.m_active);
+  ss.m_active = true;
+
+  const ReadConfigReq* req = (const ReadConfigReq*)signal->getDataPtr();
+  ss.m_readConfigReq = *req;
+  ndbrequire(ss.m_readConfigReq.noOfParameters == 0);
+
+  const Uint32 workers = globalData.ndbmtWorkers;
+  const Uint32 threads = globalData.ndbmtThreads;
+
+  Uint32 i;
+  for (i = 0; i < workers; i++) {
+    const Uint32 instanceNo = 1 + i;
+    SimulatedBlock* worker = newWorker(instanceNo);
+    ndbrequire(worker->instance() == instanceNo);
+    ndbrequire(this->getInstance(instanceNo) == worker);
+    c_worker[i] = worker;
+
+    add_worker_thr_map(number(), instanceNo);
+  }
+
+  // set after instances are created (sendpacked)
+  c_workers = workers;
+  c_threads = threads;
+
+  // run sequentially due to big mallocs and initializations
+  sendREAD_CONFIG_REQ(signal, 0);
+}
+
+void
+LocalProxy::sendREAD_CONFIG_REQ(Signal* signal, Uint32 i)
+{
+  Ss_READ_CONFIG_REQ& ss = c_ss_READ_CONFIG_REQ;
+
+  ReadConfigReq* req = (ReadConfigReq*)signal->getDataPtrSend();
+  req->senderRef = reference();
+  req->senderData = i;
+  req->noOfParameters = 0;
+  sendSignal(workerRef(i), GSN_READ_CONFIG_REQ,
+             signal, ReadConfigReq::SignalLength, JBB);
+  // for verification only
+  ss.m_worker = i;
+}
+
+void
+LocalProxy::execREAD_CONFIG_CONF(Signal* signal)
+{
+  Ss_READ_CONFIG_REQ& ss = c_ss_READ_CONFIG_REQ;
+  ndbrequire(ss.m_active);
+
+  const ReadConfigConf* conf = (const ReadConfigConf*)signal->getDataPtr();
+  ndbrequire(ss.m_worker == conf->senderData);
+  if (ss.m_worker + 1 < c_workers) {
+    jam();
+    sendREAD_CONFIG_REQ(signal, ss.m_worker + 1);
+    return;
+  }
+
+  sendREAD_CONFIG_CONF(signal);
+  ss.m_active = false;
+}
+
+void
+LocalProxy::sendREAD_CONFIG_CONF(Signal* signal)
+{
+  Ss_READ_CONFIG_REQ& ss = c_ss_READ_CONFIG_REQ;
+
+  ReadConfigConf* conf = (ReadConfigConf*)signal->getDataPtrSend();
+  conf->senderRef = reference();
+  conf->senderData = ss.m_readConfigReq.senderData;
+  sendSignal(ss.m_readConfigReq.senderRef, GSN_READ_CONFIG_CONF,
+             signal, ReadConfigConf::SignalLength, JBB);
+}
+
+BLOCK_FUNCTIONS(LocalProxy)

=== added file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,69 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_LOCAL_PROXY_HPP
+#define NDB_LOCAL_PROXY_HPP
+
+#include <pc.hpp>
+#include <SimulatedBlock.hpp>
+#include <signaldata/ReadConfig.hpp>
+
+/*
+ * Proxy blocks for MT LQH.
+ *
+ * The LQH proxy is the LQH block seen by other nodes and blocks,
+ * unless by-passed for efficiency.  Real LQH instances (workers)
+ * run behind it.
+ *
+ * There are also ACC,TUP,TUX,BACKUP,RESTORE proxies and workers.
+ * All proxy classes are subclasses of LocalProxy.
+ */
+
+class LocalProxy : public SimulatedBlock {
+public:
+  LocalProxy(BlockNumber blockNumber, Block_context& ctx);
+  virtual ~LocalProxy();
+  BLOCK_DEFINES(LocalProxy);
+
+protected:
+  enum { MaxWorkers = MAX_NDBMT_WORKERS };
+  Uint32 c_workers;
+  Uint32 c_threads;
+  SimulatedBlock* c_worker[MaxWorkers];
+
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo) = 0;
+
+  // worker index to worker ref
+  BlockReference workerRef(Uint32 i) {
+    return numberToRef(number(), 1 + i, getOwnNodeId());
+  }
+
+  // GSN_READ_CONFIG_REQ
+  struct Ss_READ_CONFIG_REQ {
+    bool m_active;
+    Uint32 m_worker;
+    ReadConfigReq m_readConfigReq;
+    Ss_READ_CONFIG_REQ() :
+      m_active(false)
+    {}
+  };
+  Ss_READ_CONFIG_REQ c_ss_READ_CONFIG_REQ;
+  void execREAD_CONFIG_REQ(Signal*);
+  void sendREAD_CONFIG_REQ(Signal*, Uint32 i);
+  void execREAD_CONFIG_CONF(Signal*);
+  void sendREAD_CONFIG_CONF(Signal*);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/Makefile.am'
--- a/storage/ndb/src/kernel/blocks/Makefile.am	2008-04-25 16:35:50 +0000
+++ b/storage/ndb/src/kernel/blocks/Makefile.am	2008-07-26 05:13:40 +0000
@@ -54,7 +54,14 @@ libblocks_a_SOURCES = tsman.cpp lgman.cp
   dbtux/DbtuxGen.cpp dbtux/DbtuxMeta.cpp dbtux/DbtuxMaint.cpp \
   dbtux/DbtuxNode.cpp dbtux/DbtuxTree.cpp dbtux/DbtuxScan.cpp \
   dbtux/DbtuxSearch.cpp dbtux/DbtuxCmp.cpp dbtux/DbtuxStat.cpp \
-  dbtux/DbtuxDebug.cpp
+  dbtux/DbtuxDebug.cpp \
+  LocalProxy.cpp \
+  dblqh/DblqhProxy.cpp \
+  dbacc/DbaccProxy.cpp \
+  dbtup/DbtupProxy.cpp \
+  dbtux/DbtuxProxy.cpp \
+  backup/BackupProxy.cpp \
+  RestoreProxy.cpp
 
 EXTRA_PROGRAMS = ndb_print_file
 ndb_print_file_SOURCES = print_file.cpp diskpage.cpp dbtup/tuppage.cpp

=== added file 'storage/ndb/src/kernel/blocks/RestoreProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/RestoreProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/RestoreProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "RestoreProxy.hpp"
+#include "restore.hpp"
+
+RestoreProxy::RestoreProxy(Block_context& ctx) :
+  LocalProxy(RESTORE, ctx)
+{
+}
+
+RestoreProxy::~RestoreProxy()
+{
+}
+
+SimulatedBlock*
+RestoreProxy::newWorker(Uint32 instanceNo)
+{
+  return new Restore(m_ctx, instanceNo);
+}
+
+BLOCK_FUNCTIONS(RestoreProxy)

=== added file 'storage/ndb/src/kernel/blocks/RestoreProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/RestoreProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/RestoreProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_RESTORE_PROXY_HPP
+#define NDB_RESTORE_PROXY_HPP
+
+#include <LocalProxy.hpp>
+
+class RestoreProxy : public LocalProxy {
+public:
+  RestoreProxy(Block_context& ctx);
+  virtual ~RestoreProxy();
+  BLOCK_DEFINES(RestoreProxy);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/backup/Backup.hpp'
--- a/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2008-06-05 20:31:21 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/Backup.hpp	2008-07-26 05:13:40 +0000
@@ -40,8 +40,10 @@
  */
 class Backup : public SimulatedBlock
 {
+  friend class BackupProxy;
+
 public:
-  Backup(Block_context& ctx);
+  Backup(Block_context& ctx, Uint32 instanceNumber = 0);
   virtual ~Backup();
   BLOCK_DEFINES(Backup);
   

=== modified file 'storage/ndb/src/kernel/blocks/backup/BackupInit.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp	2008-06-05 20:31:21 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/BackupInit.cpp	2008-07-26 05:13:40 +0000
@@ -26,8 +26,8 @@
 
 //extern const unsigned Ndbcntr::g_sysTableCount;
 
-Backup::Backup(Block_context& ctx) :
-  SimulatedBlock(BACKUP, ctx),
+Backup::Backup(Block_context& ctx, Uint32 instanceNumber) :
+  SimulatedBlock(BACKUP, ctx, instanceNumber),
   c_nodes(c_nodePool),
   c_backups(c_backupPool)
 {

=== added file 'storage/ndb/src/kernel/blocks/backup/BackupProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/backup/BackupProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/BackupProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "BackupProxy.hpp"
+#include "Backup.hpp"
+
+BackupProxy::BackupProxy(Block_context& ctx) :
+  LocalProxy(BACKUP, ctx)
+{
+}
+
+BackupProxy::~BackupProxy()
+{
+}
+
+SimulatedBlock*
+BackupProxy::newWorker(Uint32 instanceNo)
+{
+  return new Backup(m_ctx, instanceNo);
+}
+
+BLOCK_FUNCTIONS(BackupProxy)

=== added file 'storage/ndb/src/kernel/blocks/backup/BackupProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/backup/BackupProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/backup/BackupProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_BACKUP_PROXY_HPP
+#define NDB_BACKUP_PROXY_HPP
+
+#include <LocalProxy.hpp>
+
+class BackupProxy : public LocalProxy {
+public:
+  BackupProxy(Block_context& ctx);
+  virtual ~BackupProxy();
+  BLOCK_DEFINES(BackupProxy);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp	2008-07-26 05:13:40 +0000
@@ -268,6 +268,8 @@ ElementHeader::clearScanBit(Uint32 heade
 
 
 class Dbacc: public SimulatedBlock {
+  friend class DbaccProxy;
+
 public:
 // State values
 enum State {
@@ -625,7 +627,7 @@ struct Tabrec {
   typedef Ptr<Tabrec> TabrecPtr;
 
 public:
-  Dbacc(Block_context&);
+  Dbacc(Block_context&, Uint32 instanceNumber = 0);
   virtual ~Dbacc();
 
   // pointer to TUP instance in this thread

=== modified file 'storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccInit.cpp	2008-07-26 05:13:40 +0000
@@ -86,8 +86,8 @@ void Dbacc::initRecords() 
 				ctablesize);
 }//Dbacc::initRecords()
 
-Dbacc::Dbacc(Block_context& ctx):
-  SimulatedBlock(DBACC, ctx),
+Dbacc::Dbacc(Block_context& ctx, Uint32 instanceNumber):
+  SimulatedBlock(DBACC, ctx, instanceNumber),
   c_tup(0)
 {
   BLOCK_CONSTRUCTOR(Dbacc);

=== added file 'storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "DbaccProxy.hpp"
+#include "Dbacc.hpp"
+
+DbaccProxy::DbaccProxy(Block_context& ctx) :
+  LocalProxy(DBACC, ctx)
+{
+}
+
+DbaccProxy::~DbaccProxy()
+{
+}
+
+SimulatedBlock*
+DbaccProxy::newWorker(Uint32 instanceNo)
+{
+  return new Dbacc(m_ctx, instanceNo);
+}
+
+BLOCK_FUNCTIONS(DbaccProxy)

=== added file 'storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbacc/DbaccProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_DBACC_PROXY_HPP
+#define NDB_DBACC_PROXY_HPP
+
+#include <LocalProxy.hpp>
+
+class DbaccProxy : public LocalProxy {
+public:
+  DbaccProxy(Block_context& ctx);
+  virtual ~DbaccProxy();
+  BLOCK_DEFINES(DbaccProxy);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2008-06-05 20:34:20 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/Dblqh.hpp	2008-07-26 05:13:40 +0000
@@ -400,6 +400,8 @@ class Dbtup;
  *  - LOG 
  */
 class Dblqh: public SimulatedBlock {
+  friend class DblqhProxy;
+
 public:
   enum LcpCloseState {
     LCP_IDLE = 0,
@@ -2047,7 +2049,7 @@ public:
   };
   
 public:
-  Dblqh(Block_context& ctx);
+  Dblqh(Block_context& ctx, Uint32 instanceNumber = 0);
   virtual ~Dblqh();
 
   void receive_keyinfo(Signal*, Uint32 * data, Uint32 len);

=== modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhInit.cpp	2008-07-26 05:13:40 +0000
@@ -165,8 +165,8 @@ void Dblqh::initRecords() 
   bat[1].bits.v = 5;
 }//Dblqh::initRecords()
 
-Dblqh::Dblqh(Block_context& ctx):
-  SimulatedBlock(DBLQH, ctx),
+Dblqh::Dblqh(Block_context& ctx, Uint32 instanceNumber):
+  SimulatedBlock(DBLQH, ctx, instanceNumber),
   c_lcp_waiting_fragments(c_fragment_pool),
   c_lcp_restoring_fragments(c_fragment_pool),
   c_lcp_complete_fragments(c_fragment_pool),

=== added file 'storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,49 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "DblqhProxy.hpp"
+#include "Dblqh.hpp"
+
+DblqhProxy::DblqhProxy(Block_context& ctx) :
+  LocalProxy(DBLQH, ctx)
+{
+  // GSN_SEND_PACKED
+  addRecSignal(GSN_SEND_PACKED, &DblqhProxy::execSEND_PACKED);
+}
+
+DblqhProxy::~DblqhProxy()
+{
+}
+
+SimulatedBlock*
+DblqhProxy::newWorker(Uint32 instanceNo)
+{
+  return new Dblqh(m_ctx, instanceNo);
+}
+
+// GSN_SEND_PACKED
+
+void
+DblqhProxy::execSEND_PACKED(Signal* signal)
+{
+  Uint32 i;
+  for (i = 0; i < c_workers; i++) {
+    ndbrequire(c_worker[i] != 0);
+    Dblqh* dblqh = static_cast<Dblqh*>(c_worker[i]);
+    dblqh->execSEND_PACKED(signal);
+  }
+}
+
+BLOCK_FUNCTIONS(DblqhProxy)

=== added file 'storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_DBLQH_PROXY_HPP
+#define NDB_DBLQH_PROXY_HPP
+
+#include <LocalProxy.hpp>
+
+class DblqhProxy : public LocalProxy {
+public:
+  DblqhProxy(Block_context& ctx);
+  virtual ~DblqhProxy();
+  BLOCK_DEFINES(DblqhProxy);
+
+  // GSN_SEND_PACKED
+  void execSEND_PACKED(Signal*);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2008-06-05 20:34:20 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp	2008-07-26 05:13:40 +0000
@@ -344,6 +344,7 @@ inline const Uint32* ALIGN_WORD(const vo
 #endif
 
 class Dbtup: public SimulatedBlock {
+friend class DbtupProxy;
 friend class Suma;
 public:
 struct KeyReqStruct;
@@ -1651,7 +1652,7 @@ struct TupHeadInfo {
   Uint32          terrorCode;
 
 public:
-  Dbtup(Block_context&, Pgman*);
+  Dbtup(Block_context&, Pgman*, Uint32 instanceNumber = 0);
   virtual ~Dbtup();
 
   /*

=== modified file 'storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupGen.cpp	2008-07-26 05:13:40 +0000
@@ -49,8 +49,8 @@ void Dbtup::initData() 
   cpackedListIndex = 0;  
 }//Dbtup::initData()
 
-Dbtup::Dbtup(Block_context& ctx, Pgman* pgman)
-  : SimulatedBlock(DBTUP, ctx),
+Dbtup::Dbtup(Block_context& ctx, Pgman* pgman, Uint32 instanceNumber)
+  : SimulatedBlock(DBTUP, ctx, instanceNumber),
     c_lqh(0),
     m_pgman(this, pgman),
     c_extent_hash(c_extent_pool),

=== added file 'storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,47 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "DbtupProxy.hpp"
+#include "Dbtup.hpp"
+
+DbtupProxy::DbtupProxy(Block_context& ctx) :
+  LocalProxy(DBTUP, ctx)
+{
+  addRecSignal(GSN_SEND_PACKED, &DbtupProxy::execSEND_PACKED);
+}
+
+DbtupProxy::~DbtupProxy()
+{
+}
+
+SimulatedBlock*
+DbtupProxy::newWorker(Uint32 instanceNo)
+{
+  return new Dbtup(m_ctx, 0, instanceNo);
+}
+
+// GSN_SEND_PACKED
+
+void
+DbtupProxy::execSEND_PACKED(Signal* signal)
+{
+  Uint32 i;
+  for (i = 0; i < c_workers; i++) {
+    Dbtup* dbtup = static_cast<Dbtup*>(c_worker[i]);
+    dbtup->execSEND_PACKED(signal);
+  }
+}
+
+BLOCK_FUNCTIONS(DbtupProxy)

=== added file 'storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtup/DbtupProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_DBTUP_PROXY
+#define NDB_DBTUP_PROXY
+
+#include <LocalProxy.hpp>
+
+class DbtupProxy : public LocalProxy {
+public:
+  DbtupProxy(Block_context& ctx);
+  virtual ~DbtupProxy();
+  BLOCK_DEFINES(DbtupProxy);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+
+  // GSN_SEND_PACKED
+  void execSEND_PACKED(Signal*);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/Dbtux.hpp	2008-07-26 05:13:40 +0000
@@ -101,8 +101,9 @@
 class Configuration;
 
 class Dbtux : public SimulatedBlock {
+  friend class DbtuxProxy;
 public:
-  Dbtux(Block_context& ctx);
+  Dbtux(Block_context& ctx, Uint32 instanceNumber = 0);
   virtual ~Dbtux();
 
   // pointer to TUP instance in this thread

=== modified file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2008-06-05 20:19:01 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxGen.cpp	2008-07-26 05:13:40 +0000
@@ -18,8 +18,8 @@
 
 #include <signaldata/NodeStateSignalData.hpp>
 
-Dbtux::Dbtux(Block_context& ctx) :
-  SimulatedBlock(DBTUX, ctx),
+Dbtux::Dbtux(Block_context& ctx, Uint32 instanceNumber) :
+  SimulatedBlock(DBTUX, ctx, instanceNumber),
   c_tup(0),
   c_descPageList(RNIL),
 #ifdef VM_TRACE

=== added file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.cpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,34 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#include "DbtuxProxy.hpp"
+#include "Dbtux.hpp"
+
+DbtuxProxy::DbtuxProxy(Block_context& ctx) :
+  LocalProxy(DBTUX, ctx)
+{
+}
+
+DbtuxProxy::~DbtuxProxy()
+{
+}
+
+SimulatedBlock*
+DbtuxProxy::newWorker(Uint32 instanceNo)
+{
+  return new Dbtux(m_ctx, instanceNo);
+}
+
+BLOCK_FUNCTIONS(DbtuxProxy)

=== added file 'storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp	1970-01-01 00:00:00 +0000
+++ b/storage/ndb/src/kernel/blocks/dbtux/DbtuxProxy.hpp	2008-07-26 05:13:40 +0000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2003 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; 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
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
+
+#ifndef NDB_DBTUX_PROXY_HPP
+#define NDB_DBTUX_PROXY_HPP
+
+#include <LocalProxy.hpp>
+
+class DbtuxProxy : public LocalProxy {
+public:
+  DbtuxProxy(Block_context& ctx);
+  virtual ~DbtuxProxy();
+  BLOCK_DEFINES(DbtuxProxy);
+
+protected:
+  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
+};
+
+#endif

=== modified file 'storage/ndb/src/kernel/blocks/restore.cpp'
--- a/storage/ndb/src/kernel/blocks/restore.cpp	2008-03-18 07:12:39 +0000
+++ b/storage/ndb/src/kernel/blocks/restore.cpp	2008-07-26 05:13:40 +0000
@@ -32,8 +32,8 @@
 
 #define PAGES LCP_RESTORE_BUFFER
 
-Restore::Restore(Block_context& ctx) :
-  SimulatedBlock(RESTORE, ctx),
+Restore::Restore(Block_context& ctx, Uint32 instanceNumber) :
+  SimulatedBlock(RESTORE, ctx, instanceNumber),
   m_file_list(m_file_pool),
   m_file_hash(m_file_pool)
 {

=== modified file 'storage/ndb/src/kernel/blocks/restore.hpp'
--- a/storage/ndb/src/kernel/blocks/restore.hpp	2008-03-18 07:12:39 +0000
+++ b/storage/ndb/src/kernel/blocks/restore.hpp	2008-07-26 05:13:40 +0000
@@ -28,8 +28,10 @@
 
 class Restore : public SimulatedBlock
 {
+  friend class RestoreProxy;
+
 public:
-  Restore(Block_context& ctx);
+  Restore(Block_context& ctx, Uint32 instanceNumber = 0);
   virtual ~Restore();
   BLOCK_DEFINES(Restore);
   

Thread
bzr commit into mysql-5.1-telco-6.4 branch (pekka:2683) WL#4391Pekka Nousiainen26 Jul