cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject [1/4] cassandra git commit: Don't initiate snitch reconnection for dead states
Date Fri, 17 Apr 2015 22:39:04 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-2.0 724384ab0 -> 54140bfde
  refs/heads/cassandra-2.1 b4fae8557 -> a92526239
  refs/heads/trunk 11dfc0253 -> 4040ba8e7


Don't initiate snitch reconnection for dead states

Patch by brandonwilliams, reviewed by John Alberts for CASSANDRA-7292


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

Branch: refs/heads/cassandra-2.0
Commit: 54140bfde562361562489879f720e78e0ea0eac7
Parents: 724384a
Author: Brandon Williams <brandonwilliams@apache.org>
Authored: Fri Apr 17 17:36:55 2015 -0500
Committer: Brandon Williams <brandonwilliams@apache.org>
Committed: Fri Apr 17 17:36:55 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                                 | 1 +
 .../apache/cassandra/locator/ReconnectableSnitchHelper.java | 9 +++------
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54140bfd/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a492c74..6c546c4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.15:
+ * Don't initiate snitch reconnection for dead states (CASSANDRA-7292)
  * Fix ArrayIndexOutOfBoundsException in CQLSSTableWriter (CASSANDRA-8978)
  * Add shutdown gossip state to prevent timeouts during rolling restarts (CASSANDRA-8336)
  * Fix running with java.net.preferIPv6Addresses=true (CASSANDRA-9137)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54140bfd/src/java/org/apache/cassandra/locator/ReconnectableSnitchHelper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/ReconnectableSnitchHelper.java b/src/java/org/apache/cassandra/locator/ReconnectableSnitchHelper.java
index d797393..1642561 100644
--- a/src/java/org/apache/cassandra/locator/ReconnectableSnitchHelper.java
+++ b/src/java/org/apache/cassandra/locator/ReconnectableSnitchHelper.java
@@ -21,10 +21,7 @@ package org.apache.cassandra.locator;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
-import org.apache.cassandra.gms.ApplicationState;
-import org.apache.cassandra.gms.EndpointState;
-import org.apache.cassandra.gms.IEndpointStateChangeSubscriber;
-import org.apache.cassandra.gms.VersionedValue;
+import org.apache.cassandra.gms.*;
 import org.apache.cassandra.net.MessagingService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -78,13 +75,13 @@ public class ReconnectableSnitchHelper implements IEndpointStateChangeSubscriber
 
     public void onJoin(InetAddress endpoint, EndpointState epState)
     {
-        if (preferLocal && epState.getApplicationState(ApplicationState.INTERNAL_IP)
!= null)
+        if (preferLocal && !Gossiper.instance.isDeadState(epState) && epState.getApplicationState(ApplicationState.INTERNAL_IP)
!= null)
             reconnect(endpoint, epState.getApplicationState(ApplicationState.INTERNAL_IP));
     }
 
     public void onChange(InetAddress endpoint, ApplicationState state, VersionedValue value)
     {
-        if (preferLocal && state == ApplicationState.INTERNAL_IP)
+        if (preferLocal && !Gossiper.instance.isDeadState(epState) && state
== ApplicationState.INTERNAL_IP)
             reconnect(endpoint, value);
     }
 


Mime
View raw message