You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by ja...@apache.org on 2015/07/22 15:05:00 UTC

[1/8] cassandra git commit: checkForEndpointCollision fails for legitimate collisions, CASSANDRA-9765

Repository: cassandra
Updated Branches:
  refs/heads/trunk daa3fe611 -> 7659ae2ee


checkForEndpointCollision fails for legitimate collisions, CASSANDRA-9765


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

Branch: refs/heads/trunk
Commit: 2c9b490c972a7d7bca698d03c2a212fcf22a7a63
Parents: 52dbc3f
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Fri Jul 10 14:22:32 2015 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Fri Jul 10 14:22:32 2015 +0800

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java | 45 +++++++++++++++-----
 .../cassandra/service/StorageService.java       |  2 +-
 2 files changed, 36 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c9b490c/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index b77064d..23eff82 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -678,6 +678,16 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         }
     }
 
+    /**
+     * A fat client is a node that has not joined the ring, therefore acting as a coordinator only.
+     * It possesses no data. This method attempts to determine this property, except that for dead nodes
+     * we cannot tell. (??) We should also check that the node is not shutdown (and possibly other states)
+     * but due to fear of breaking things I added a new method to do this, isLiveFatClient(), see
+     * CASSANDRA-9765 for more information.
+     *
+     * @param endpoint - the endpoint we need to check
+     * @return true if it is a fat client
+     */
     public boolean isFatClient(InetAddress endpoint)
     {
         EndpointState epState = endpointStateMap.get(endpoint);
@@ -688,6 +698,11 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         return !isDeadState(epState) && !StorageService.instance.getTokenMetadata().isMember(endpoint);
     }
 
+    public boolean isLiveFatClient(InetAddress endpoint)
+    {
+        return isFatClient(endpoint) && !isShutdownState(endpointStateMap.get(endpoint));
+    }
+
     private void doStatusCheck()
     {
         if (logger.isTraceEnabled())
@@ -1008,12 +1023,9 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     public boolean isDeadState(EndpointState epState)
     {
-        if (epState.getApplicationState(ApplicationState.STATUS) == null)
+        String state = getApplicationState(epState);
+        if (state.isEmpty())
             return false;
-        String value = epState.getApplicationState(ApplicationState.STATUS).value;
-        String[] pieces = value.split(VersionedValue.DELIMITER_STR, -1);
-        assert (pieces.length > 0);
-        String state = pieces[0];
         for (String deadstate : DEAD_STATES)
         {
             if (state.equals(deadstate))
@@ -1024,12 +1036,9 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     public boolean isSilentShutdownState(EndpointState epState)
     {
-        if (epState.getApplicationState(ApplicationState.STATUS) == null)
+        String state = getApplicationState(epState);
+        if (state.isEmpty())
             return false;
-        String value = epState.getApplicationState(ApplicationState.STATUS).value;
-        String[] pieces = value.split(VersionedValue.DELIMITER_STR, -1);
-        assert (pieces.length > 0);
-        String state = pieces[0];
         for (String deadstate : SILENT_SHUTDOWN_STATES)
         {
             if (state.equals(deadstate))
@@ -1038,6 +1047,22 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         return false;
     }
 
+    public boolean isShutdownState(EndpointState epState)
+    {
+        return getApplicationState(epState).equals(VersionedValue.SHUTDOWN);
+    }
+
+    private static String getApplicationState(EndpointState epState)
+    {
+        if (epState == null || epState.getApplicationState(ApplicationState.STATUS) == null)
+            return "";
+
+        String value = epState.getApplicationState(ApplicationState.STATUS).value;
+        String[] pieces = value.split(VersionedValue.DELIMITER_STR, -1);
+        assert (pieces.length > 0);
+        return pieces[0];
+    }
+
     void applyStateLocally(Map<InetAddress, EndpointState> epStateMap)
     {
         for (Entry<InetAddress, EndpointState> entry : epStateMap.entrySet())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/2c9b490c/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 a256ce7..d70fff2 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -456,7 +456,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
             MessagingService.instance().listen(FBUtilities.getLocalAddress());
         Gossiper.instance.doShadowRound();
         EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress());
-        if (epState != null && !Gossiper.instance.isDeadState(epState) && !Gossiper.instance.isFatClient(FBUtilities.getBroadcastAddress()))
+        if (epState != null && !Gossiper.instance.isDeadState(epState) && !Gossiper.instance.isLiveFatClient(FBUtilities.getBroadcastAddress()))
         {
             throw new RuntimeException(String.format("A node with address %s already exists, cancelling join. " +
                                                      "Use cassandra.replace_address if you want to replace this node.",


[2/8] cassandra git commit: checkForEndpointCollision fails for legitimate collisions, improved version after CR, CASSANDRA-9765

Posted by ja...@apache.org.
checkForEndpointCollision fails for legitimate collisions, improved version after CR, CASSANDRA-9765


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

Branch: refs/heads/trunk
Commit: 54470a25f3c3c9ce6cb600c798ddcfe5e3962768
Parents: 2c9b490
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Wed Jul 15 16:30:22 2015 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Wed Jul 15 16:30:22 2015 +0800

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java | 35 +++++++++++++-------
 .../cassandra/service/StorageService.java       |  3 +-
 2 files changed, 24 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/54470a25/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 23eff82..8eecc98 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -680,12 +680,8 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     /**
      * A fat client is a node that has not joined the ring, therefore acting as a coordinator only.
-     * It possesses no data. This method attempts to determine this property, except that for dead nodes
-     * we cannot tell. (??) We should also check that the node is not shutdown (and possibly other states)
-     * but due to fear of breaking things I added a new method to do this, isLiveFatClient(), see
-     * CASSANDRA-9765 for more information.
      *
-     * @param endpoint - the endpoint we need to check
+     * @param endpoint - the endpoint to check
      * @return true if it is a fat client
      */
     public boolean isFatClient(InetAddress endpoint)
@@ -698,9 +694,29 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         return !isDeadState(epState) && !StorageService.instance.getTokenMetadata().isMember(endpoint);
     }
 
-    public boolean isLiveFatClient(InetAddress endpoint)
+    /**
+     * Check if this endpoint can safely bootstrap into the cluster.
+     *
+     * @param endpoint - the endpoint to check
+     * @return true if the endpoint can join the cluster
+     */
+    public boolean isSafeForBootstrap(InetAddress endpoint)
     {
-        return isFatClient(endpoint) && !isShutdownState(endpointStateMap.get(endpoint));
+        EndpointState epState = endpointStateMap.get(endpoint);
+        String state = getApplicationState(epState);
+        logger.info("{} state : {}", endpoint, state);
+
+        // if there's no previous state, or the node was previously removed from the cluster, we're good
+        if (epState == null || isDeadState(epState))
+            return true;
+
+        // these states are not allowed to join the cluster
+        List<String> states = new ArrayList<String>() {{
+            add(""); // failed bootstrap but we did start gossiping
+            add(VersionedValue.STATUS_NORMAL); // node is legit in the cluster or was stopped kill -9
+            //add(VersionedValue.STATUS_BOOTSTRAPPING); // failed bootstrap
+            add(VersionedValue.SHUTDOWN); }}; // node was shutdown
+        return !states.contains(state);
     }
 
     private void doStatusCheck()
@@ -1047,11 +1063,6 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
         return false;
     }
 
-    public boolean isShutdownState(EndpointState epState)
-    {
-        return getApplicationState(epState).equals(VersionedValue.SHUTDOWN);
-    }
-
     private static String getApplicationState(EndpointState epState)
     {
         if (epState == null || epState.getApplicationState(ApplicationState.STATUS) == null)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/54470a25/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 d70fff2..745fe4c 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -455,8 +455,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
         if (!MessagingService.instance().isListening())
             MessagingService.instance().listen(FBUtilities.getLocalAddress());
         Gossiper.instance.doShadowRound();
-        EndpointState epState = Gossiper.instance.getEndpointStateForEndpoint(FBUtilities.getBroadcastAddress());
-        if (epState != null && !Gossiper.instance.isDeadState(epState) && !Gossiper.instance.isLiveFatClient(FBUtilities.getBroadcastAddress()))
+        if (!Gossiper.instance.isSafeForBootstrap(FBUtilities.getBroadcastAddress()))
         {
             throw new RuntimeException(String.format("A node with address %s already exists, cancelling join. " +
                                                      "Use cassandra.replace_address if you want to replace this node.",


[5/8] cassandra git commit: changes.txt

Posted by ja...@apache.org.
changes.txt


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

Branch: refs/heads/trunk
Commit: 704ca66f995f328107c5dccf978554616e062aae
Parents: 046ff1e
Author: Jason Brown <ja...@gmail.com>
Authored: Wed Jul 22 05:57:58 2015 -0700
Committer: Jason Brown <ja...@gmail.com>
Committed: Wed Jul 22 05:57:58 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/704ca66f/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index f20fad8..f1e855e 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.0.17
+ * checkForEndpointCollision fails for legitimate collisions (CASSANDRA-9765)
  * Complete CASSANDRA-8448 fix (CASSANDRA-9519)
  * Don't include auth credentials in debug log (CASSANDRA-9682)
  * Can't transition from write survey to normal mode (CASSANDRA-9740)


[7/8] cassandra git commit: Merge branch 'cassandra-2.1' into cassandra-2.2

Posted by ja...@apache.org.
Merge branch 'cassandra-2.1' into cassandra-2.2

Conflicts:
	src/java/org/apache/cassandra/gms/Gossiper.java
	src/java/org/apache/cassandra/service/StorageService.java


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

Branch: refs/heads/trunk
Commit: 11ac9388782992867432fc48ca4f1587e20b7171
Parents: ee89c7e c2142e6
Author: Jason Brown <ja...@gmail.com>
Authored: Wed Jul 22 06:04:11 2015 -0700
Committer: Jason Brown <ja...@gmail.com>
Committed: Wed Jul 22 06:04:11 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 56 ++++++++++++++------
 .../cassandra/service/StorageService.java       |  3 +-
 3 files changed, 42 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11ac9388/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 3895e1f,5d142cc..0fb392a
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -14,7 -5,9 +14,8 @@@ Merged from 2.1
   * Fix clientutil jar and tests (CASSANDRA-9760)
   * (cqlsh) Allow the SSL protocol version to be specified through the
     config file or environment variables (CASSANDRA-9544)
 - * Remove repair snapshot leftover on startup (CASSANDRA-7357)
  Merged from 2.0:
+  * checkForEndpointCollision fails for legitimate collisions (CASSANDRA-9765)
   * Complete CASSANDRA-8448 fix (CASSANDRA-9519)
   * Don't include auth credentials in debug log (CASSANDRA-9682)
   * Can't transition from write survey to normal mode (CASSANDRA-9740)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11ac9388/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/gms/Gossiper.java
index e131da6,f4764ce..e61a35a
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@@ -1004,25 -1042,13 +1028,21 @@@ public class Gossiper implements IFailu
              markAsShutdown(ep);
      }
  
 +    public boolean isAlive(InetAddress endpoint)
 +    {
 +        EndpointState epState = getEndpointStateForEndpoint(endpoint);
 +        if (epState == null)
 +            return false;
 +        return epState.isAlive() && !isDeadState(epState);
 +    }
 +
      public boolean isDeadState(EndpointState epState)
      {
-         String state = epState.getStatus();
-         if (state.isEmpty())
+         String status = getGossipStatus(epState);
+         if (status.isEmpty())
              return false;
-         for (String deadstate : DEAD_STATES)
-         {
-             if (state.equals(deadstate))
-                 return true;
-         }
-         return false;
+ 
+         return DEAD_STATES.contains(status);
      }
  
      public boolean isSilentShutdownState(EndpointState epState)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11ac9388/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------


[8/8] cassandra git commit: Merge branch 'cassandra-2.2' into trunk

Posted by ja...@apache.org.
Merge branch 'cassandra-2.2' into trunk


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

Branch: refs/heads/trunk
Commit: 7659ae2eefd2fc20776b11e1961b3d57f0f1e9c6
Parents: daa3fe6 11ac938
Author: Jason Brown <ja...@gmail.com>
Authored: Wed Jul 22 06:04:46 2015 -0700
Committer: Jason Brown <ja...@gmail.com>
Committed: Wed Jul 22 06:04:46 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 56 ++++++++++++++------
 .../cassandra/service/StorageService.java       |  3 +-
 3 files changed, 42 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/7659ae2e/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 793140b,0fb392a..56c3495
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -36,8 -13,9 +36,9 @@@ Merged from 2.1
   * Handle corrupt files on startup (CASSANDRA-9686)
   * Fix clientutil jar and tests (CASSANDRA-9760)
   * (cqlsh) Allow the SSL protocol version to be specified through the
 -   config file or environment variables (CASSANDRA-9544)
 +    config file or environment variables (CASSANDRA-9544)
  Merged from 2.0:
+  * checkForEndpointCollision fails for legitimate collisions (CASSANDRA-9765)
   * Complete CASSANDRA-8448 fix (CASSANDRA-9519)
   * Don't include auth credentials in debug log (CASSANDRA-9682)
   * Can't transition from write survey to normal mode (CASSANDRA-9740)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/7659ae2e/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------


[4/8] cassandra git commit: checkForEndpointCollision fails for legitimate collisions

Posted by ja...@apache.org.
checkForEndpointCollision fails for legitimate collisions

patch by stefania; reviewed by jasobrown for CASSANDRA-9765


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

Branch: refs/heads/trunk
Commit: 046ff1e5d3dbbbc5f6d49c695044a6601597ca1b
Parents: 0ef1888 ba9a69e
Author: Jason Brown <ja...@gmail.com>
Authored: Wed Jul 22 05:57:17 2015 -0700
Committer: Jason Brown <ja...@gmail.com>
Committed: Wed Jul 22 05:57:17 2015 -0700

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java | 65 ++++++++++++++------
 .../cassandra/service/StorageService.java       |  3 +-
 2 files changed, 47 insertions(+), 21 deletions(-)
----------------------------------------------------------------------



[3/8] cassandra git commit: checkForEndpointCollision fails for legitimate collisions, finalized list of statuses and nits, CASSANDRA-9765

Posted by ja...@apache.org.
checkForEndpointCollision fails for legitimate collisions, finalized list of statuses and nits, CASSANDRA-9765


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

Branch: refs/heads/trunk
Commit: ba9a69ea21b6cf2e70408ba62522a4a58b695e3f
Parents: 54470a2
Author: Stefania Alborghetti <st...@datastax.com>
Authored: Thu Jul 16 10:04:58 2015 +0800
Committer: Stefania Alborghetti <st...@datastax.com>
Committed: Thu Jul 16 10:04:58 2015 +0800

----------------------------------------------------------------------
 src/java/org/apache/cassandra/gms/Gossiper.java | 39 ++++++++------------
 1 file changed, 15 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/ba9a69ea/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/gms/Gossiper.java b/src/java/org/apache/cassandra/gms/Gossiper.java
index 8eecc98..8c36223 100644
--- a/src/java/org/apache/cassandra/gms/Gossiper.java
+++ b/src/java/org/apache/cassandra/gms/Gossiper.java
@@ -703,20 +703,19 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
     public boolean isSafeForBootstrap(InetAddress endpoint)
     {
         EndpointState epState = endpointStateMap.get(endpoint);
-        String state = getApplicationState(epState);
-        logger.info("{} state : {}", endpoint, state);
 
         // if there's no previous state, or the node was previously removed from the cluster, we're good
         if (epState == null || isDeadState(epState))
             return true;
 
-        // these states are not allowed to join the cluster
-        List<String> states = new ArrayList<String>() {{
+        String status = getGossipStatus(epState);
+
+        // these states are not allowed to join the cluster as it would not be safe
+        final List<String> unsafeStatuses = new ArrayList<String>() {{
             add(""); // failed bootstrap but we did start gossiping
-            add(VersionedValue.STATUS_NORMAL); // node is legit in the cluster or was stopped kill -9
-            //add(VersionedValue.STATUS_BOOTSTRAPPING); // failed bootstrap
+            add(VersionedValue.STATUS_NORMAL); // node is legit in the cluster or it was stopped with kill -9
             add(VersionedValue.SHUTDOWN); }}; // node was shutdown
-        return !states.contains(state);
+        return !unsafeStatuses.contains(status);
     }
 
     private void doStatusCheck()
@@ -1039,31 +1038,23 @@ public class Gossiper implements IFailureDetectionEventListener, GossiperMBean
 
     public boolean isDeadState(EndpointState epState)
     {
-        String state = getApplicationState(epState);
-        if (state.isEmpty())
+        String status = getGossipStatus(epState);
+        if (status.isEmpty())
             return false;
-        for (String deadstate : DEAD_STATES)
-        {
-            if (state.equals(deadstate))
-                return true;
-        }
-        return false;
+
+        return DEAD_STATES.contains(status);
     }
 
     public boolean isSilentShutdownState(EndpointState epState)
     {
-        String state = getApplicationState(epState);
-        if (state.isEmpty())
+        String status = getGossipStatus(epState);
+        if (status.isEmpty())
             return false;
-        for (String deadstate : SILENT_SHUTDOWN_STATES)
-        {
-            if (state.equals(deadstate))
-                return true;
-        }
-        return false;
+
+        return SILENT_SHUTDOWN_STATES.contains(status);
     }
 
-    private static String getApplicationState(EndpointState epState)
+    private static String getGossipStatus(EndpointState epState)
     {
         if (epState == null || epState.getApplicationState(ApplicationState.STATUS) == null)
             return "";


[6/8] cassandra git commit: Merge branch 'cassandra-2.0' into cassandra-2.1

Posted by ja...@apache.org.
Merge branch 'cassandra-2.0' into cassandra-2.1

Conflicts:
	CHANGES.txt


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

Branch: refs/heads/trunk
Commit: c2142e65496ab81b60a1a4c8bbebf44b6fa438f0
Parents: 172a975 704ca66
Author: Jason Brown <ja...@gmail.com>
Authored: Wed Jul 22 06:01:14 2015 -0700
Committer: Jason Brown <ja...@gmail.com>
Committed: Wed Jul 22 06:01:14 2015 -0700

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 src/java/org/apache/cassandra/gms/Gossiper.java | 65 ++++++++++++++------
 .../cassandra/service/StorageService.java       |  3 +-
 3 files changed, 48 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c2142e65/CHANGES.txt
----------------------------------------------------------------------
diff --cc CHANGES.txt
index 0d015db,f1e855e..5d142cc
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@@ -1,12 -1,5 +1,13 @@@
 -2.0.17
 +2.1.9
 + * Fix MarshalException when upgrading superColumn family (CASSANDRA-9582)
 + * Fix broken logging for "empty" flushes in Memtable (CASSANDRA-9837)
 + * Handle corrupt files on startup (CASSANDRA-9686)
 + * Fix clientutil jar and tests (CASSANDRA-9760)
 + * (cqlsh) Allow the SSL protocol version to be specified through the
 +   config file or environment variables (CASSANDRA-9544)
 + * Remove repair snapshot leftover on startup (CASSANDRA-7357)
 +Merged from 2.0:
+  * checkForEndpointCollision fails for legitimate collisions (CASSANDRA-9765)
   * Complete CASSANDRA-8448 fix (CASSANDRA-9519)
   * Don't include auth credentials in debug log (CASSANDRA-9682)
   * Can't transition from write survey to normal mode (CASSANDRA-9740)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c2142e65/src/java/org/apache/cassandra/gms/Gossiper.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c2142e65/src/java/org/apache/cassandra/service/StorageService.java
----------------------------------------------------------------------