diff --git a/CHANGES.txt b/CHANGES.txt index 7f768d021a..fea0026c71 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,7 @@ * Make sure sstables with moved starts are removed correctly in LeveledGenerations (CASSANDRA-16552) * Upgrade jackson-databind to 2.9.10.8 (CASSANDRA-16462) Merged from 3.0: + * Don't allow seeds to replace without using unsafe (CASSANDRA-14463) * Calculate time remaining correctly for all compaction types in compactionstats (CASSANDRA-14701) * Receipt of gossip shutdown notification updates TokenMetadata (CASSANDRA-16796) * Count bloom filter misses correctly (CASSANDRA-12922) diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java index 898cef950a..9cfdd8092a 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -579,7 +579,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE if (!joinRing) throw new ConfigurationException("Cannot set both join_ring=false and attempt to replace a node"); - if (!DatabaseDescriptor.isAutoBootstrap() && !Boolean.getBoolean("cassandra.allow_unsafe_replace")) + if (!shouldBootstrap() && !Boolean.getBoolean("cassandra.allow_unsafe_replace")) throw new RuntimeException("Replacing a node without bootstrapping risks invalidating consistency " + "guarantees as the expected data may not be present until repair is run. " + "To perform this operation, please restart with " + @@ -866,7 +866,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE localHostId = prepareForReplacement(); appStates.put(ApplicationState.TOKENS, valueFactory.tokens(bootstrapTokens)); - if (!DatabaseDescriptor.isAutoBootstrap()) + if (!shouldBootstrap()) { // Will not do replace procedure, persist the tokens we're taking over locally // so that they don't get clobbered with auto generated ones in joinTokenRing