List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:May 18 2011 9:07am
Subject:bzr commit into mysql-5.1-telco-7.0 branch (jonas:4393)
View as plain text  
#At file:///home/jonas/src/telco-7.0/ based on revid:jonas@stripped

 4393 Jonas Oreland	2011-05-18
      ndb - move apiConnectRecord (pool) onto c_diverify_queue

    modified:
      storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp
      storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp
=== modified file 'storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2011-05-18 07:46:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/Dbdih.hpp	2011-05-18 09:07:07 +0000
@@ -1268,7 +1268,6 @@ private:
 
   // Variables to support record structures and their free lists
 
-  ApiConnectRecord *apiConnectRecord;
   Uint32 capiConnectFileSize;
 
   ConnectRecord *connectRecord;
@@ -1318,10 +1317,12 @@ private:
     DIVERIFY_queue() {
       cfirstVerifyQueue = clastVerifyQueue = RNIL;
       cverifyQueueCounter = 0;
+      apiConnectRecord = 0;
     }
     Uint32 cfirstVerifyQueue;
     Uint32 clastVerifyQueue;
     Uint32 cverifyQueueCounter;
+    ApiConnectRecord *apiConnectRecord;
   };
 
   bool isEmpty(const DIVERIFY_queue&);
@@ -1329,6 +1330,7 @@ private:
   void dequeue(DIVERIFY_queue&, Ptr<ApiConnectRecord> &);
 
   DIVERIFY_queue c_diverify_queue[1];
+  Uint32 c_diverify_queue_cnt;
 
   /*------------------------------------------------------------------------*/
   /*       THIS VARIABLE KEEPS THE REFERENCES TO FILE RECORDS THAT DESCRIBE */

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2011-02-15 11:41:27 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihInit.cpp	2011-05-18 09:07:07 +0000
@@ -73,13 +73,16 @@ void Dbdih::initData() 
   c_2pass_inr = false;
 }//Dbdih::initData()
 
-void Dbdih::initRecords() 
+void Dbdih::initRecords()
 {
   // Records with dynamic sizes
-  apiConnectRecord = (ApiConnectRecord*)
-    allocRecord("ApiConnectRecord", 
-                sizeof(ApiConnectRecord),
-                capiConnectFileSize);
+  for (Uint32 i = 0; i < c_diverify_queue_cnt; i++)
+  {
+    c_diverify_queue[i].apiConnectRecord = (ApiConnectRecord*)
+      allocRecord("ApiConnectRecord",
+                  sizeof(ApiConnectRecord),
+                  capiConnectFileSize);
+  }
 
   connectRecord = (ConnectRecord*)allocRecord("ConnectRecord",
                                               sizeof(ConnectRecord), 
@@ -306,7 +309,6 @@ Dbdih::Dbdih(Block_context& ctx):
                &Dbdih::execDIH_GET_TABINFO_CONF);
 #endif
 
-  apiConnectRecord = 0;
   connectRecord = 0;
   fileRecord = 0;
   fragmentstore = 0;
@@ -319,15 +321,20 @@ Dbdih::Dbdih(Block_context& ctx):
   c_nextNodeGroup = 0;
   c_fragments_per_node = 1;
   bzero(c_node_groups, sizeof(c_node_groups));
+  c_diverify_queue_cnt = 1;
 
 }//Dbdih::Dbdih()
 
-Dbdih::~Dbdih() 
+Dbdih::~Dbdih()
 {
-  deallocRecord((void **)&apiConnectRecord, "ApiConnectRecord", 
-                sizeof(ApiConnectRecord),
-                capiConnectFileSize);
-  
+  for (Uint32 i = 0; i<c_diverify_queue_cnt; i++)
+  {
+    deallocRecord((void **)&c_diverify_queue[i].apiConnectRecord,
+                  "ApiConnectRecord",
+                  sizeof(ApiConnectRecord),
+                  capiConnectFileSize);
+  }
+
   deallocRecord((void **)&connectRecord, "ConnectRecord",
                 sizeof(ConnectRecord), 
                 cconnectFileSize);

=== modified file 'storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp'
--- a/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-05-18 07:46:28 +0000
+++ b/storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp	2011-05-18 09:07:07 +0000
@@ -9215,6 +9215,7 @@ Dbdih::enqueue(DIVERIFY_queue & q, Ptr<A
   Uint32 first = q.cfirstVerifyQueue;
   Uint32 last = q.clastVerifyQueue;
   Uint32 count = q.cverifyQueueCounter;
+  ApiConnectRecord * apiConnectRecord = q.apiConnectRecord;
 
   Ptr<ApiConnectRecord> tmp;
   tmp.i = last;
@@ -9241,6 +9242,7 @@ Dbdih::dequeue(DIVERIFY_queue & q, Ptr<A
   Uint32 first = q.cfirstVerifyQueue;
   Uint32 last = q.clastVerifyQueue;
   Uint32 count = q.cverifyQueueCounter;
+  ApiConnectRecord * apiConnectRecord = q.apiConnectRecord;
 
   conRecord.i = first;
   ptrCheckGuard(conRecord, capiConnectFileSize, apiConnectRecord);
@@ -9293,13 +9295,14 @@ void Dbdih::execDIVERIFYREQ(Signal* sign
   // queue to ensure that operation starts up in the correct order.
   /*-------------------------------------------------------------------------*/
   ApiConnectRecordPtr localApiConnectptr;
+  DIVERIFY_queue & q = c_diverify_queue[0];
 
   localApiConnectptr.i = signal->theData[0];
-  ptrCheckGuard(localApiConnectptr, capiConnectFileSize, apiConnectRecord);
+  ptrCheckGuard(localApiConnectptr, capiConnectFileSize, q.apiConnectRecord);
   localApiConnectptr.p->apiGci = m_micro_gcp.m_new_gci;
   localApiConnectptr.p->nextApi = RNIL;
 
-  enqueue(c_diverify_queue[0], localApiConnectptr);
+  enqueue(q, localApiConnectptr);
   emptyverificbuffer(signal, false);
   signal->theData[3] = 1; // Indicate no immediate return
   return;
@@ -15452,12 +15455,17 @@ void Dbdih::initialiseRecordsLab(Signal*
   case 1:{
     ApiConnectRecordPtr apiConnectptr;
     jam();
-    /******** INTIALIZING API CONNECT RECORDS ********/
-    for (apiConnectptr.i = 0; apiConnectptr.i < capiConnectFileSize; apiConnectptr.i++) {
-      refresh_watch_dog();
-      ptrAss(apiConnectptr, apiConnectRecord);
-      apiConnectptr.p->nextApi = RNIL;
-    }//for
+    for (Uint32 i = 0; i < c_diverify_queue_cnt; i++)
+    {
+      /******** INTIALIZING API CONNECT RECORDS ********/
+      for (apiConnectptr.i = 0;
+           apiConnectptr.i < capiConnectFileSize; apiConnectptr.i++)
+      {
+        refresh_watch_dog();
+        ptrAss(apiConnectptr, c_diverify_queue[i].apiConnectRecord);
+        apiConnectptr.p->nextApi = RNIL;
+      }//for
+    }
     jam();
     break;
   }
@@ -17244,7 +17252,7 @@ Dbdih::execDUMP_STATE_ORD(Signal* signal
   if (arg == DumpStateOrd::DihDumpNodeRestartInfo) {
     infoEvent("c_nodeStartMaster.blockLcp = %d, c_nodeStartMaster.blockGcp = %d, c_nodeStartMaster.wait = %d",
 	      c_nodeStartMaster.blockLcp, c_nodeStartMaster.blockGcp, c_nodeStartMaster.wait);
-    for (Uint32 i = 0; i<NDB_ARRAY_SIZE(c_diverify_queue); i++)
+    for (Uint32 i = 0; i < c_diverify_queue_cnt; i++)
     {
       infoEvent("[ %u : cfirstVerifyQueue = 0x%.8x, cverifyQueueCounter = %u ]",
                 i,


Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20110518090707-hmi1dqzdw73xbe22.bundle
Thread
bzr commit into mysql-5.1-telco-7.0 branch (jonas:4393) Jonas Oreland18 May