Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 54140bfde -> 738229bd7 refs/heads/cassandra-2.1 a92526239 -> c6e437983 refs/heads/trunk 4040ba8e7 -> f0d4705e6
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.1 Commit: 54140bfde562361562489879f720e78e0ea0eac7 Parents: 724384a Author: Brandon Williams <brandonwilli...@apache.org> Authored: Fri Apr 17 17:36:55 2015 -0500 Committer: Brandon Williams <brandonwilli...@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); }