cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [1/3] cassandra git commit: Improve handling of dead nodes in gossip
Date Wed, 04 Nov 2015 14:05:18 GMT
Repository: cassandra
Updated Branches:
  refs/heads/cassandra-3.0 1492be07c -> 8f985852f


Improve handling of dead nodes in gossip

patch by Dikang Gu; reviewed by Stefania Alborghetti for CASSANDRA-10298


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

Branch: refs/heads/cassandra-3.0
Commit: b6015fa4883182531d66527780fce34c9b125e46
Parents: dc73c0b
Author: Dikang Gu <dikang85@gmail.com>
Authored: Wed Nov 4 13:50:33 2015 +0000
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Wed Nov 4 13:56:42 2015 +0000

----------------------------------------------------------------------
 CHANGES.txt                                          |  1 +
 .../apache/cassandra/db/HintedHandOffManager.java    |  4 ++++
 .../org/apache/cassandra/service/StorageService.java | 15 ++++++++++++---
 3 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6015fa4/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fd6c8a1..5ceabb4 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.12
+ * Improve handling of dead nodes in gossip (CASSANDRA-10298)
  * Fix logback-tools.xml incorrectly configured for outputing to System.err
    (CASSANDRA-9937)
  * Fix streaming to catch exception so retry not fail (CASSANDRA-10557)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6015fa4/src/java/org/apache/cassandra/db/HintedHandOffManager.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/db/HintedHandOffManager.java b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
index 6f9d0b1..4fbdd27 100644
--- a/src/java/org/apache/cassandra/db/HintedHandOffManager.java
+++ b/src/java/org/apache/cassandra/db/HintedHandOffManager.java
@@ -213,7 +213,11 @@ public class HintedHandOffManager implements HintedHandOffManagerMBean
     {
         if (!StorageService.instance.getTokenMetadata().isMember(endpoint))
             return;
+
         UUID hostId = StorageService.instance.getTokenMetadata().getHostId(endpoint);
+        if (hostId == null)
+            return;
+
         ByteBuffer hostIdBytes = ByteBuffer.wrap(UUIDGen.decompose(hostId));
         final Mutation mutation = new Mutation(Keyspace.SYSTEM_KS, hostIdBytes);
         mutation.delete(SystemKeyspace.HINTS_CF, System.currentTimeMillis());

http://git-wip-us.apache.org/repos/asf/cassandra/blob/b6015fa4/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 7e5b67b..d02a572 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1858,8 +1858,16 @@ public class StorageService extends NotificationBroadcasterSupport
implements IE
     private void handleStateLeft(InetAddress endpoint, String[] pieces)
     {
         assert pieces.length >= 2;
-        Collection<Token> tokens;
-        tokens = getTokensFor(endpoint);
+        Collection<Token> tokens = null;
+        try
+        {
+            tokens = getTokensFor(endpoint);
+        }
+        catch (Throwable th)
+        {
+            JVMStabilityInspector.inspectThrowable(th);
+            logger.warn("Unable to calculate tokens for {}.", endpoint);
+        }
 
         if (logger.isDebugEnabled())
             logger.debug("Node {} state left, tokens {}", endpoint, tokens);
@@ -1948,7 +1956,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
         HintedHandOffManager.instance.deleteHintsForEndpoint(endpoint);
         removeEndpoint(endpoint);
         tokenMetadata.removeEndpoint(endpoint);
-        tokenMetadata.removeBootstrapTokens(tokens);
+        if (tokens != null)
+            tokenMetadata.removeBootstrapTokens(tokens);
 
         if (!isClientMode)
         {


Mime
View raw message