mirror of https://github.com/apache/cassandra
refuse to decomission if not in state NORMAL
patch by Jan Karlsson and Stefania for CASSANDRA-8741
This commit is contained in:
parent
517058febb
commit
5bc56c3e40
|
|
@ -1,4 +1,5 @@
|
|||
2.0.17
|
||||
* Disallow decommission when node is in drained state (CASSANDRA-8741)
|
||||
* Backport CASSANDRA-8013 to 2.0 (CASSANDRA-10144)
|
||||
* Make getFullyExpiredSSTables less expensive (CASSANDRA-9882)
|
||||
* Add tool to find why expired sstables are not getting dropped (CASSANDRA-10015)
|
||||
|
|
|
|||
|
|
@ -2963,6 +2963,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())
|
||||
|
|
|
|||
|
|
@ -1366,7 +1366,8 @@ public class NodeCmd
|
|||
System.err.println("Decommission will decommission the node you are connected to and does not take arguments!");
|
||||
System.exit(1);
|
||||
}
|
||||
probe.decommission();
|
||||
try { probe.decommission(); }
|
||||
catch (UnsupportedOperationException e) { err("Unsupported operation: " + e.getMessage()); }
|
||||
break;
|
||||
|
||||
case DRAIN :
|
||||
|
|
@ -1678,6 +1679,12 @@ public class NodeCmd
|
|||
System.exit(1);
|
||||
}
|
||||
|
||||
private static void err(String useStr)
|
||||
{
|
||||
System.err.println(useStr);
|
||||
System.exit(1);
|
||||
}
|
||||
|
||||
private static void err(Exception e, String errStr)
|
||||
{
|
||||
System.err.println(errStr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue