cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [09/22] cassandra git commit: refuse to decomission if not in state NORMAL patch by Jan Karlsson and Stefania for CASSANDRA-8741
Date Fri, 04 Sep 2015 14:18:35 GMT
refuse to decomission if not in state NORMAL
patch by Jan Karlsson and Stefania for CASSANDRA-8741


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

Branch: refs/heads/cassandra-2.2
Commit: 27754c0a41087a2419c09fd99707fd7235cce4ad
Parents: fe80052
Author: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Authored: Thu Aug 27 10:01:07 2015 +0800
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Sep 4 09:15:56 2015 -0500

----------------------------------------------------------------------
 CHANGES.txt                                               | 2 ++
 src/java/org/apache/cassandra/service/StorageService.java | 2 ++
 src/java/org/apache/cassandra/tools/NodeTool.java         | 3 +++
 3 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/27754c0a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 681a40b..6d43c98 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,8 @@
  * Only check KeyCache when it is enabled
  * Change streaming_socket_timeout_in_ms default to 1 hour (CASSANDRA-8611)
  * (cqlsh) update list of CQL keywords (CASSANDRA-9232)
+Merged from 2.0:
+ * Disallow decommission when node is in drained state (CASSANDRA-8741)
 
 
 2.1.9

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27754c0a/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 56ddd63..acc82e6 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -3281,6 +3281,8 @@ public class StorageService extends NotificationBroadcasterSupport implements
IE
             throw new UnsupportedOperationException("local node is not a member of the token
ring yet");
         if (tokenMetadata.cloneAfterAllLeft().sortedTokens().size() < 2)
             throw new UnsupportedOperationException("no other normal nodes in the ring; decommission
would be pointless");
+        if (operationMode != Mode.NORMAL)
+            throw new UnsupportedOperationException("Node in " + operationMode + " state;
wait for status to become normal or restart");
 
         PendingRangeCalculatorService.instance.blockUntilFinished();
         for (String keyspaceName : Schema.instance.getNonSystemKeyspaces())

http://git-wip-us.apache.org/repos/asf/cassandra/blob/27754c0a/src/java/org/apache/cassandra/tools/NodeTool.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/tools/NodeTool.java b/src/java/org/apache/cassandra/tools/NodeTool.java
index 8e88f45..277f42c 100644
--- a/src/java/org/apache/cassandra/tools/NodeTool.java
+++ b/src/java/org/apache/cassandra/tools/NodeTool.java
@@ -1471,6 +1471,9 @@ public class NodeTool
             } catch (InterruptedException e)
             {
                 throw new RuntimeException("Error decommissioning node", e);
+            } catch (UnsupportedOperationException e)
+            {
+                throw new IllegalStateException("Unsupported operation: " + e.getMessage(),
e);
             }
         }
     }


Mime
View raw message