List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 29 2010 7:42am
Subject:bzr push into mysql-5.1-telco-7.1 branch (jonas:3839 to 3840)
View as plain text  
 3840 Jonas Oreland	2010-09-29 [merge]
      ndb - merge 70 to 71

    modified:
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.hpp
 3839 Magnus Blåudd	2010-09-28 [merge]
      Merge 7.0 -> 7.1

    removed:
      cluster_change_hist.txt
=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.cpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-09-06 08:20:33 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-09-29 07:39:42 +0000
@@ -1251,10 +1251,10 @@ Suma::execNODE_FAILREP(Signal* signal){
 	  progError(__LINE__, NDBD_EXIT_SYSTEM_ERROR, 
 		    "Nodefailure during SUMA takeover");
 	}
-        else if (state & Bucket::BUCKET_SHUTDOWN)
+        else if (state & Bucket::BUCKET_SHUTDOWN_TO)
         {
           jam();
-          c_buckets[i].m_state &= ~Uint32(Bucket::BUCKET_SHUTDOWN);
+          c_buckets[i].m_state &= ~Uint32(Bucket::BUCKET_SHUTDOWN_TO);
           m_switchover_buckets.clear(i);
           ndbrequire(get_responsible_node(i, tmp) == getOwnNodeId());
           start_resend(signal, i);
@@ -3964,7 +3964,11 @@ Suma::get_responsible_node(Uint32 bucket
 bool
 Suma::check_switchover(Uint32 bucket, Uint64 gci)
 {
-  const Uint32 send_mask = (Bucket::BUCKET_STARTING | Bucket::BUCKET_TAKEOVER);
+  const Uint32 send_mask = 
+    Bucket::BUCKET_STARTING |
+    Bucket::BUCKET_TAKEOVER |
+    Bucket::BUCKET_SHUTDOWN_TO;
+
   bool send = c_buckets[bucket].m_state & send_mask;
   ndbassert(m_switchover_buckets.get(bucket));
   if(unlikely(gci > c_buckets[bucket].m_switchover_gci))
@@ -4453,27 +4457,27 @@ found:
         }
         else if (state & Bucket::BUCKET_SHUTDOWN)
         {
+          jam();
           Uint32 nodeId = c_buckets[i].m_switchover_node;
-          if (nodeId == getOwnNodeId())
-          {
-            jam();
-            m_active_buckets.clear(i);
-            m_gcp_complete_rep_count--;
-            ndbout_c("shutdown handover");
-          }
-          else
-          {
-            jam();
-            NdbNodeBitmask nodegroup = c_nodes_in_nodegroup_mask;
-            nodegroup.clear(nodeId);
-            ndbrequire(get_responsible_node(i) == nodeId &&
-                       get_responsible_node(i, nodegroup) == getOwnNodeId());
-            m_active_buckets.set(i);
-            m_gcp_complete_rep_count++;
-            ndbout_c("shutdown takover");
-          }
+          ndbrequire(nodeId == getOwnNodeId());
+          m_active_buckets.clear(i);
+          m_gcp_complete_rep_count--;
+          ndbout_c("shutdown handover");
           c_buckets[i].m_state &= ~(Uint32)Bucket::BUCKET_SHUTDOWN;
         }
+        else if (state & Bucket::BUCKET_SHUTDOWN_TO)
+        {
+          jam();
+          Uint32 nodeId = c_buckets[i].m_switchover_node;
+          NdbNodeBitmask nodegroup = c_nodes_in_nodegroup_mask;
+          nodegroup.clear(nodeId);
+          ndbrequire(get_responsible_node(i) == nodeId &&
+                     get_responsible_node(i, nodegroup) == getOwnNodeId());
+          m_active_buckets.set(i);
+          m_gcp_complete_rep_count++;
+          ndbout_c("shutdown takover");
+          c_buckets[i].m_state &= ~(Uint32)Bucket::BUCKET_SHUTDOWN_TO;
+        }
       }
     }
 
@@ -5482,7 +5486,7 @@ Suma::execSUMA_HANDOVER_REQ(Signal* sign
         tmp.set(i);
         m_switchover_buckets.set(i);
         c_buckets[i].m_switchover_gci = (Uint64(start_gci) << 32) - 1;
-        c_buckets[i].m_state |= Bucket::BUCKET_SHUTDOWN;
+        c_buckets[i].m_state |= Bucket::BUCKET_SHUTDOWN_TO;
         c_buckets[i].m_switchover_node = nodeId;
         ndbout_c("prepare to takeover bucket: %d", i);
       }

=== modified file 'storage/ndb/src/kernel/blocks/suma/Suma.hpp'
--- a/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2010-08-26 12:33:33 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2010-09-29 07:39:42 +0000
@@ -589,6 +589,7 @@ private:
       ,BUCKET_DROPPED_OTHER = 0x80 // New nodegroup (not me)
       ,BUCKET_DROPPED_MASK  = (BUCKET_DROPPED_SELF | BUCKET_DROPPED_OTHER)
       ,BUCKET_SHUTDOWN = 0x100 // Graceful shutdown
+      ,BUCKET_SHUTDOWN_TO = 0x200 // Graceful shutdown
     };
     Uint16 m_state;
     Uint16 m_switchover_node;

Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100929074055-bh2dnt4u58mqe3l9.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (jonas:3839 to 3840) Jonas Oreland29 Sep