List:Commits« Previous MessageNext Message »
From:Jonas Oreland Date:September 29 2010 7:42am
Subject:bzr push into mysql-5.1-telco-6.3 branch (jonas:3307 to 3308) Bug#55641
View as plain text  
 3308 Jonas Oreland	2010-09-29
      ndb - bug#55641 - followup fix, fix check_switchover

    modified:
      storage/ndb/src/kernel/blocks/suma/Suma.cpp
      storage/ndb/src/kernel/blocks/suma/Suma.hpp
 3307 Magnus Blåudd	2010-09-28
      BUG#56116 Remove unmaintained file
       - Removing the 'cluster_change_hist.txt' file since it has not been maintained
        since 2007

    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:14:08 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp	2010-09-29 07:36:31 +0000
@@ -1101,10 +1101,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);
@@ -3569,7 +3569,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))
@@ -3864,24 +3868,26 @@ Suma::execSUB_GCP_COMPLETE_REP(Signal* s
 	}
         else if (state & Bucket::BUCKET_SHUTDOWN)
         {
+          jam();
           Uint32 nodeId = c_buckets[i].m_switchover_node;
-          if (nodeId == getOwnNodeId())
-          {
-            jam();
-            m_active_buckets.clear(i);
-            shutdown_nodes.set(nodeId);
-          }
-          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);
-            takeover_nodes.set(nodeId);
-          }
+          ndbrequire(nodeId == getOwnNodeId());
+          m_active_buckets.clear(i);
+          shutdown_nodes.set(nodeId);
           c_buckets[i].m_state &= ~(Uint32)Bucket::BUCKET_SHUTDOWN;
+          ndbout_c(" 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);
+          takeover_nodes.set(nodeId);
+          c_buckets[i].m_state &= ~(Uint32)Bucket::BUCKET_SHUTDOWN_TO;
+          ndbout_c(" shutdown_to");
         }
 	else
 	{
@@ -4880,7 +4886,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 09:00:51 +0000
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.hpp	2010-09-29 07:36:31 +0000
@@ -570,7 +570,8 @@ private:
       ,BUCKET_HANDOVER = 0x2 // On running node
       ,BUCKET_TAKEOVER = 0x4 // On takeing over node
       ,BUCKET_RESEND   = 0x8 // On takeing over node
-      ,BUCKET_SHUTDOWN = 0x10 // Graceful shutdown
+      ,BUCKET_SHUTDOWN = 0x10 // Graceful shutdown (shutdown)
+      ,BUCKET_SHUTDOWN_TO = 0x20 // Graceful shutdown (take-over)
     };
     Uint16 m_state;
     Uint16 m_switchover_node;

Attachment: [text/bzr-bundle] bzr/jonas@mysql.com-20100929073631-xzt5ipk6hbps4tik.bundle
Thread
bzr push into mysql-5.1-telco-6.3 branch (jonas:3307 to 3308) Bug#55641Jonas Oreland29 Sep