cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From slebre...@apache.org
Subject [1/2] git commit: Ensures all UP events are reported by the native protocol
Date Fri, 19 Jul 2013 06:54:02 GMT
Updated Branches:
  refs/heads/trunk 57769f6bb -> 8f72229db


Ensures all UP events are reported by the native protocol

patch by slebresne; reviewed by jasobrown for CASSANDRA-5769


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/27efded3
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/27efded3
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/27efded3

Branch: refs/heads/trunk
Commit: 27efded38d855b24f41e5332ffb29cd13d98f8da
Parents: 373c033
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Fri Jul 19 08:52:19 2013 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Fri Jul 19 08:53:37 2013 +0200

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../cassandra/service/StorageService.java       | 27 ++++++++++----------
 2 files changed, 14 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27efded3/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 80b73f4..f8a3f09 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -21,6 +21,7 @@
  * cqlsh: handle CUSTOM 2i in DESCRIBE output (CASSANDRA-5760)
  * Fix minor bug in Range.intersects(Bound) (CASSANDRA-5771)
  * cqlsh: handle disabled compression in DESCRIBE output (CASSANDRA-5766)
+ * Ensure all UP events are notified on the native protocol (CASSANDRA-5769)
 
 
 1.2.6

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27efded3/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index d166553..26c4d1c 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1351,21 +1351,8 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
             logger.debug("Node " + endpoint + " state normal, token " + tokens);
 
         if (tokenMetadata.isMember(endpoint))
-        {
             logger.info("Node " + endpoint + " state jump to normal");
 
-            if (!isClientMode)
-            {
-                for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
-                    subscriber.onUp(endpoint);
-            }
-        }
-        else if (!isClientMode)
-        {
-            for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
-                subscriber.onJoinCluster(endpoint);
-        }
-
         // Order Matters, TM.updateHostID() should be called before TM.updateNormalToken(),
(see CASSANDRA-4300).
         if (Gossiper.instance.usesHostId(endpoint))
             tokenMetadata.updateHostId(Gossiper.instance.getHostId(endpoint), endpoint);
@@ -1976,8 +1963,20 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
 
     public void onAlive(InetAddress endpoint, EndpointState state)
     {
-        if (!isClientMode && getTokenMetadata().isMember(endpoint))
+        if (isClientMode)
+            return;
+
+        if (tokenMetadata.isMember(endpoint))
+        {
             HintedHandOffManager.instance.scheduleHintDelivery(endpoint);
+            for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
+                subscriber.onUp(endpoint);
+        }
+        else
+        {
+            for (IEndpointLifecycleSubscriber subscriber : lifecycleSubscribers)
+                subscriber.onJoinCluster(endpoint);
+        }
     }
 
     public void onRemove(InetAddress endpoint)


Mime
View raw message