List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:February 2 2012 11:45am
Subject:bzr push into mysql-5.5-cluster-7.2 branch (jonas.oreland:3803 to 3804)
View as plain text  
 3804 Jonas Oreland	2012-02-02 [merge]
      ndb - merge 71 to 72

    modified:
      storage/ndb/include/kernel/ndb_limits.h
      storage/ndb/src/kernel/vm/SimulatedBlock.hpp
      storage/ndb/src/kernel/vm/mt.cpp
 3803 jonas oreland	2012-02-01 [merge]
      ndb - merge 71 to 72

    modified:
      mysql-test/suite/ndb/r/ndb_statistics0.result
      mysql-test/suite/ndb/r/ndb_statistics1.result
      mysql-test/suite/ndb/t/ndb_index_stat.test
      mysql-test/suite/ndb/t/ndb_index_stat_restart.test
      mysql-test/suite/ndb/t/ndb_statistics.inc
      mysql-test/suite/ndb/t/ndb_statistics0.test
      mysql-test/suite/ndb/t/ndb_statistics1.test
      storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp
=== modified file 'storage/ndb/include/kernel/ndb_limits.h'
--- a/storage/ndb/include/kernel/ndb_limits.h	2012-01-30 15:12:41 +0000
+++ b/storage/ndb/include/kernel/ndb_limits.h	2012-02-02 11:43:58 +0000
@@ -199,6 +199,7 @@
 #define NDBMT_BLOCK_BITS 9
 #define NDBMT_BLOCK_MASK ((1 << NDBMT_BLOCK_BITS) - 1)
 #define NDBMT_BLOCK_INSTANCE_BITS 7
+#define NDBMT_MAX_BLOCK_INSTANCES (1 << NDBMT_BLOCK_INSTANCE_BITS)
 
 #define NDB_DEFAULT_LOG_PARTS 4
 

=== modified file 'storage/ndb/src/kernel/vm/SimulatedBlock.hpp'
--- a/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2012-01-04 14:25:32 +0000
+++ b/storage/ndb/src/kernel/vm/SimulatedBlock.hpp	2012-02-02 11:43:58 +0000
@@ -635,10 +635,7 @@ private:
    * are real LQHs run by multiple threads.
    */
 protected:
-  enum { MaxInstances = 3 +
-         MAX_NDBMT_TC_THREADS +
-         MAX_NDBMT_LQH_WORKERS +
-         MAX_NDBMT_RECEIVE_THREADS };
+  enum { MaxInstances = NDBMT_MAX_BLOCK_INSTANCES };
 private:
   SimulatedBlock** theInstanceList; // set in main, indexed by instance
   SimulatedBlock* theMainInstance;  // set in all

=== modified file 'storage/ndb/src/kernel/vm/mt.cpp'
--- a/storage/ndb/src/kernel/vm/mt.cpp	2012-01-31 18:28:03 +0000
+++ b/storage/ndb/src/kernel/vm/mt.cpp	2012-02-02 11:43:58 +0000
@@ -84,7 +84,6 @@ static const Uint32 MAX_SIGNALS_BEFORE_W
                            MAX_NDBMT_LQH_THREADS +  \
                            MAX_NDBMT_TC_THREADS +   \
                            MAX_NDBMT_RECEIVE_THREADS)
-#define MAX_BLOCK_INSTANCES (MAX_BLOCK_THREADS+1)
 
 /* If this is too small it crashes before first signal. */
 #define MAX_INSTANCES_PER_THREAD (16 + 8 * MAX_NDBMT_LQH_THREADS)
@@ -3242,14 +3241,14 @@ struct thr_map_entry {
   thr_map_entry() : thr_no(NULL_THR_NO) {}
 };
 
-static struct thr_map_entry thr_map[NO_OF_BLOCKS][MAX_BLOCK_INSTANCES];
+static struct thr_map_entry thr_map[NO_OF_BLOCKS][NDBMT_MAX_BLOCK_INSTANCES];
 
 static inline Uint32
 block2ThreadId(Uint32 block, Uint32 instance)
 {
   assert(block >= MIN_BLOCK_NO && block <= MAX_BLOCK_NO);
   Uint32 index = block - MIN_BLOCK_NO;
-  assert(instance < MAX_BLOCK_INSTANCES);
+  assert(instance < NDB_ARRAY_SIZE(thr_map[index]));
   const thr_map_entry& entry = thr_map[index][instance];
   assert(entry.thr_no < num_threads);
   return entry.thr_no;
@@ -3261,7 +3260,7 @@ add_thr_map(Uint32 main, Uint32 instance
   assert(main == blockToMain(main));
   Uint32 index = main - MIN_BLOCK_NO;
   assert(index < NO_OF_BLOCKS);
-  assert(instance < MAX_BLOCK_INSTANCES);
+  assert(instance < NDB_ARRAY_SIZE(thr_map[index]));
 
   SimulatedBlock* b = globalData.getBlock(main, instance);
   require(b != 0);
@@ -3419,14 +3418,14 @@ mt_finalize_thr_map()
   {
     Uint32 bno = b + MIN_BLOCK_NO;
     Uint32 cnt = 0;
-    while (cnt < MAX_BLOCK_INSTANCES &&
+    while (cnt < NDB_ARRAY_SIZE(thr_map[b]) &&
            thr_map[b][cnt].thr_no != thr_map_entry::NULL_THR_NO)
       cnt++;
 
-    if (cnt != MAX_BLOCK_INSTANCES)
+    if (cnt != NDB_ARRAY_SIZE(thr_map[b]))
     {
       SimulatedBlock * main = globalData.getBlock(bno, 0);
-      for (Uint32 i = cnt; i < MAX_BLOCK_INSTANCES; i++)
+      for (Uint32 i = cnt; i < NDB_ARRAY_SIZE(thr_map[b]); i++)
       {
         Uint32 dup = (cnt == 1) ? 0 : 1 + ((i - 1) % (cnt - 1));
         if (thr_map[b][i].thr_no == thr_map_entry::NULL_THR_NO)
@@ -4937,7 +4936,7 @@ mt_get_thread_references_for_blocks(cons
      */
     assert(block == blockToMain(block));
     Uint32 index = block - MIN_BLOCK_NO;
-    for (Uint32 instance = 0; instance < MAX_BLOCK_INSTANCES; instance++)
+    for (Uint32 instance = 0; instance < NDB_ARRAY_SIZE(thr_map[instance]); instance++)
     {
       Uint32 thr_no = thr_map[index][instance].thr_no;
       if (thr_no == thr_map_entry::NULL_THR_NO)

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-5.5-cluster-7.2 branch (jonas.oreland:3803 to 3804) Jonas Oreland17 Feb