CASSANDRA-13613, fix NPE in StorageService.excise()

Patch by Ariel Weisberg; Reviewed by Jason Brown for CASSANDRA-13613


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

Branch: refs/heads/trunk
Commit: 18b77c3e0b8988956e42b1362eb350dfada27eb0
Parents: 617c8eb
Author: Ariel Weisberg <ariel.weisb...@datastax.com>
Authored: Fri Jan 27 17:08:23 2017 -0500
Committer: Ariel Weisberg <aweisb...@apple.com>
Committed: Wed May 3 17:05:07 2017 -0400

----------------------------------------------------------------------
 CHANGES.txt                                               | 1 +
 src/java/org/apache/cassandra/service/StorageService.java | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/18b77c3e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 9ec6c95..17a11ab 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.14
+ * Fix NPE in StorageService.excise() (CASSANDRA-13163)
  * Expire OutboundTcpConnection messages by a single Thread (CASSANDRA-13265)
  * Fail repair if insufficient responses received (CASSANDRA-13397)
  * Fix SSTableLoader fail when the loaded table contains dropped columns 
(CASSANDRA-13276)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/18b77c3e/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 143b402..9bc046f 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -2247,8 +2247,9 @@ public class StorageService extends 
NotificationBroadcasterSupport implements IE
     {
         logger.info("Removing tokens {} for {}", tokens, endpoint);
 
-        if (tokenMetadata.isMember(endpoint))
-            HintsService.instance.excise(tokenMetadata.getHostId(endpoint));
+        UUID hostId = tokenMetadata.getHostId(endpoint);
+        if (hostId != null && tokenMetadata.isMember(endpoint))
+            HintsService.instance.excise(hostId);
 
         removeEndpoint(endpoint);
         tokenMetadata.removeEndpoint(endpoint);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to