Repository: cassandra Updated Branches: refs/heads/cassandra-2.0 c656ffe4d -> 2ab7b07ac
Fix replace_address after CASSANDRA-7356 broke it Patch by Tyler Hobbs and Marcus Eriksson; reviewed by Brandon Williams for CASSANDRA-7356 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/d84b692e Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/d84b692e Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/d84b692e Branch: refs/heads/cassandra-2.0 Commit: d84b692eb1cc0fbc55f047ec61c6a1c2cabe8b46 Parents: 66e1e46 Author: Tyler Hobbs <ty...@datastax.com> Authored: Wed Jun 25 10:34:30 2014 -0500 Committer: Tyler Hobbs <ty...@datastax.com> Committed: Wed Jun 25 10:34:30 2014 -0500 ---------------------------------------------------------------------- src/java/org/apache/cassandra/config/DatabaseDescriptor.java | 2 -- src/java/org/apache/cassandra/service/StorageService.java | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/d84b692e/src/java/org/apache/cassandra/config/DatabaseDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 3c58b57..1e534f9 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -777,8 +777,6 @@ public class DatabaseDescriptor logger.info("Replace address on first boot requested; this node is already bootstrapped"); return false; } - if (getReplaceAddress() != null && SystemTable.bootstrapComplete()) - throw new RuntimeException("Cannot replace address with a node that is already bootstrapped"); return getReplaceAddress() != null; } http://git-wip-us.apache.org/repos/asf/cassandra/blob/d84b692e/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 449a371..1f3d1e1 100644 --- a/src/java/org/apache/cassandra/service/StorageService.java +++ b/src/java/org/apache/cassandra/service/StorageService.java @@ -608,6 +608,8 @@ public class StorageService extends NotificationBroadcasterSupport implements IE throw new RuntimeException("Replace method removed; use cassandra.replace_address instead"); if (DatabaseDescriptor.isReplacing()) { + if (SystemTable.bootstrapComplete()) + throw new RuntimeException("Cannot replace address with a node that is already bootstrapped"); if (!DatabaseDescriptor.isAutoBootstrap()) throw new RuntimeException("Trying to replace_address with auto_bootstrap disabled will not work, check your configuration"); tokens = prepareReplacementInfo();