List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:December 3 2010 4:49pm
Subject:bzr commit into mysql-5.1-telco-7.1 branch (frazer:3743)
View as plain text  
#At file:///home/frazer/bzr/mysql-5.1-telco-7.1-vzw/ based on revid:frazer@stripped

 3743 Frazer Clement	2010-12-03
      Sync blocks along specific path patch for special branch.

    modified:
      storage/ndb/include/kernel/GlobalSignalNumbers.h
      storage/ndb/include/kernel/signaldata/Sync.hpp
      storage/ndb/src/common/debugger/signaldata/SignalNames.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.cpp
      storage/ndb/src/kernel/blocks/LocalProxy.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
      storage/ndb/src/kernel/vm/SimulatedBlock.cpp
      storage/ndb/src/kernel/vm/SimulatedBlock.hpp
=== modified file 'storage/ndb/include/kernel/GlobalSignalNumbers.h'
--- a/storage/ndb/include/kernel/GlobalSignalNumbers.h	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/include/kernel/GlobalSignalNumbers.h	2010-12-03 16:48:55 +0000
@@ -824,8 +824,8 @@ extern const GlobalSignalNumber NO_OF_SI
 #define GSN_SYNC_REF                    611
 #define GSN_SYNC_CONF                   612
 
-#define GSN_613
-#define GSN_614
+#define GSN_SYNC_PATH_REQ               613
+#define GSN_SYNC_PATH_CONF              614
 #define GSN_615
 #define GSN_616
 #define GSN_617

=== modified file 'storage/ndb/include/kernel/signaldata/Sync.hpp'
--- a/storage/ndb/include/kernel/signaldata/Sync.hpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/include/kernel/signaldata/Sync.hpp	2010-12-03 16:48:55 +0000
@@ -47,6 +47,25 @@ struct SyncConf
   Uint32 senderRef;
   Uint32 senderData;
 
+  STATIC_CONST( SignalLength = 3 );
+};
+
+struct SyncPathReq
+{
+  Uint32 senderData;
+  Uint32 prio;
+  Uint32 count;
+  Uint32 pathlen;
+  Uint32 path[1];
+
+  STATIC_CONST( SignalLength = 4 );
+};
+
+struct SyncPathConf
+{
+  Uint32 senderData;
+  Uint32 count;
+
   STATIC_CONST( SignalLength = 2 );
 };
 

=== modified file 'storage/ndb/src/common/debugger/signaldata/SignalNames.cpp'
--- a/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/common/debugger/signaldata/SignalNames.cpp	2010-12-03 16:48:55 +0000
@@ -758,5 +758,8 @@ const GsnName SignalNames [] = {
   ,{ GSN_SYNC_REQ, "SYNC_REQ" }
   ,{ GSN_SYNC_REF, "SYNC_REF" }
   ,{ GSN_SYNC_CONF, "SYNC_CONF" }
+
+  ,{ GSN_SYNC_PATH_REQ, "SYNC_PATH_REQ" }
+  ,{ GSN_SYNC_PATH_CONF, "SYNC_PATH_CONF" }
 };
 const unsigned short NO_OF_SIGNAL_NAMES = sizeof(SignalNames)/sizeof(GsnName);

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.cpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.cpp	2010-12-03 16:48:55 +0000
@@ -92,6 +92,9 @@ LocalProxy::LocalProxy(BlockNumber block
   addRecSignal(GSN_SYNC_REQ, &LocalProxy::execSYNC_REQ, true);
   addRecSignal(GSN_SYNC_REF, &LocalProxy::execSYNC_REF);
   addRecSignal(GSN_SYNC_CONF, &LocalProxy::execSYNC_CONF);
+
+  // GSN_SYNC_PATH_REQ
+  addRecSignal(GSN_SYNC_PATH_REQ, &LocalProxy::execSYNC_PATH_REQ, true);
 }
 
 LocalProxy::~LocalProxy()
@@ -1303,4 +1306,20 @@ LocalProxy::sendSYNC_CONF(Signal* signal
   ssRelease<Ss_SYNC_REQ>(ssId);
 }
 
+void
+LocalProxy::execSYNC_PATH_REQ(Signal* signal)
+{
+  SyncPathReq* req = CAST_PTR(SyncPathReq, signal->getDataPtrSend());
+  req->count *= c_workers;
+
+  for (Uint32 i = 0; i < c_workers; i++)
+  {
+    jam();
+    Uint32 ref = numberToRef(number(), workerInstance(i), getOwnNodeId());
+    sendSignal(ref, GSN_SYNC_PATH_REQ, signal,
+               signal->getLength(),
+               JobBufferLevel(req->prio));
+  }
+}
+
 BLOCK_FUNCTIONS(LocalProxy)

=== modified file 'storage/ndb/src/kernel/blocks/LocalProxy.hpp'
--- a/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/kernel/blocks/LocalProxy.hpp	2010-12-03 16:48:55 +0000
@@ -587,6 +587,8 @@ protected:
     }
   };
   SsPool<Ss_SYNC_REQ> c_ss_SYNC_REQ;
+
+  void execSYNC_PATH_REQ(Signal*);
 };
 
 #endif

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2010-12-03 16:48:55 +0000
@@ -9898,8 +9898,8 @@ void Dbdih::execGCP_TCFINISHED(Signal* s
   Callback cb;
   cb.m_callbackData = 10;
   cb.m_callbackFunction = safe_cast(&Dbdih::execGCP_TCFINISHED_sync_conf);
-  Uint32 blocks[] = { DBLQH, 0 };
-  synchronize_threads_for_blocks(signal, blocks, cb);
+  Uint32 path[] = { DBLQH, SUMA, 0 };
+  synchronize_path(signal, path, cb);
 }//Dbdih::execGCP_TCFINISHED()
 
 void

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.cpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.cpp	2010-12-03 16:48:55 +0000
@@ -44,6 +44,7 @@
 #include <signaldata/SignalDroppedRep.hpp>
 #include <signaldata/LocalRouteOrd.hpp>
 #include <signaldata/TransIdAI.hpp>
+#include <signaldata/Sync.hpp>
 #include <DebuggerNames.hpp>
 #include "LongSignal.hpp"
 
@@ -218,6 +219,8 @@ SimulatedBlock::installSimulatedBlockFun
   a[GSN_SYNC_THREAD_CONF] = &SimulatedBlock::execSYNC_THREAD_CONF;
   a[GSN_LOCAL_ROUTE_ORD] = &SimulatedBlock::execLOCAL_ROUTE_ORD;
   a[GSN_SYNC_REQ] = &SimulatedBlock::execSYNC_REQ;
+  a[GSN_SYNC_PATH_REQ] = &SimulatedBlock::execSYNC_PATH_REQ;
+  a[GSN_SYNC_PATH_CONF] = &SimulatedBlock::execSYNC_PATH_CONF;
 }
 
 void
@@ -4142,6 +4145,100 @@ SimulatedBlock::execSYNC_REQ(Signal* sig
              JobBufferLevel(prio));
 }
 
+void
+SimulatedBlock::synchronize_path(Signal * signal,
+                                 const Uint32 blocks[],
+                                 const Callback & cb,
+                                 JobBufferLevel prio)
+{
+  ljam();
+
+  // reuse SyncThreadRecord
+  Ptr<SyncThreadRecord> ptr;
+  ndbrequire(c_syncThreadPool.seize(ptr));
+  ptr.p->m_cnt = 0; // with count of 0
+  ptr.p->m_callback = cb;
+
+  SyncPathReq* req = CAST_PTR(SyncPathReq, signal->getDataPtrSend());
+  req->senderData = ptr.i;
+  req->prio = Uint32(prio);
+  req->count = 1;
+  if (blocks[0] == 0)
+  {
+    ljam();
+    ndbrequire(false); // TODO
+  }
+  else
+  {
+    ljam();
+    Uint32 len = 0;
+    for (; blocks[len+1] != 0; len++)
+    {
+      req->path[len] = blocks[len+1];
+    }
+    req->pathlen = 1 + len;
+    req->path[len] = reference();
+    sendSignal(numberToRef(blocks[0], getOwnNodeId()),
+               GSN_SYNC_PATH_REQ, signal,
+               SyncPathReq::SignalLength + (1 + len), prio);
+  }
+}
+
+void
+SimulatedBlock::execSYNC_PATH_REQ(Signal* signal)
+{
+  ljamEntry();
+  SyncPathReq * req = CAST_PTR(SyncPathReq, signal->getDataPtrSend());
+  if (req->pathlen == 1)
+  {
+    ljam();
+    SyncPathReq copy = *req;
+    SyncPathConf* conf = CAST_PTR(SyncPathConf, signal->getDataPtrSend());
+    conf->senderData = copy.senderData;
+    conf->count = copy.count;
+    sendSignal(copy.path[0], GSN_SYNC_PATH_CONF, signal,
+               SyncPathConf::SignalLength, JobBufferLevel(copy.prio));
+  }
+  else
+  {
+    ljam();
+    Uint32 ref = numberToRef(req->path[0], getOwnNodeId());
+    req->pathlen--;
+    memmove(req->path, req->path + 1, 4 * req->pathlen);
+    sendSignal(ref, GSN_SYNC_PATH_REQ, signal,
+               SyncPathReq::SignalLength + (1 + req->pathlen),
+               JobBufferLevel(req->prio));
+  }
+}
+
+void
+SimulatedBlock::execSYNC_PATH_CONF(Signal* signal)
+{
+  ljamEntry();
+  SyncPathConf conf = * CAST_CONSTPTR(SyncPathConf, signal->getDataPtr());
+  Ptr<SyncThreadRecord> ptr;
+
+  c_syncThreadPool.getPtr(ptr, conf.senderData);
+
+  if (ptr.p->m_cnt == 0)
+  {
+    ljam();
+    ptr.p->m_cnt = conf.count;
+  }
+
+  if (ptr.p->m_cnt == 1)
+  {
+    ljam();
+    Callback copy = ptr.p->m_callback;
+    c_syncThreadPool.release(ptr);
+    execute(signal, copy, 0);
+    return;
+  }
+
+  ptr.p->m_cnt --;
+}
+
+
 bool
 SimulatedBlock::checkNodeFailSequence(Signal* signal)
 {

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2010-12-03 16:06:40 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2010-12-03 16:48:55 +0000
@@ -207,6 +207,13 @@ public:
   void synchronize_threads_for_blocks(Signal*, const Uint32 blocks[],
                                       const Callback&, JobBufferLevel = JBB);
   
+  /**
+   * This method make sure that the path specified in blocks[]
+   *   will be traversed before returning
+   */
+  void synchronize_path(Signal*, const Uint32 blocks[],
+                        const Callback&, JobBufferLevel = JBB);
+
 private:
   struct SyncThreadRecord
   {
@@ -219,6 +226,9 @@ private:
   void execSYNC_THREAD_CONF(Signal*);
 
   void execSYNC_REQ(Signal*);
+
+  void execSYNC_PATH_REQ(Signal*);
+  void execSYNC_PATH_CONF(Signal*);
 public:
   virtual const char* get_filename(Uint32 fd) const { return "";}
 protected:


Attachment: [text/bzr-bundle] bzr/frazer@mysql.com-20101203164855-u30tqfqe7m1i216o.bundle
Thread
bzr commit into mysql-5.1-telco-7.1 branch (frazer:3743) Frazer Clement3 Dec