diff --git a/db/config.cc b/db/config.cc index 4c3fa4a3b9..463bafff00 100644 --- a/db/config.cc +++ b/db/config.cc @@ -740,8 +740,6 @@ db::config::config(std::shared_ptr exts) , consistent_rangemovement(this, "consistent_rangemovement", value_status::Used, true, "When set to true, range movements will be consistent. It means: 1) it will refuse to bootstrap a new node if other bootstrapping/leaving/moving nodes detected. 2) data will be streamed to a new node only from the node which is no longer responsible for the token range. Same as -Dcassandra.consistent.rangemovement in cassandra") , join_ring(this, "join_ring", value_status::Unused, true, "When set to true, a node will join the token ring. When set to false, a node will not join the token ring. User can use nodetool join to initiate ring joinging later. Same as -Dcassandra.join_ring in cassandra.") , load_ring_state(this, "load_ring_state", value_status::Used, true, "When set to true, load tokens and host_ids previously saved. Same as -Dcassandra.load_ring_state in cassandra.") - , replace_node(this, "replace_node", value_status::Used, "", "The UUID of the node to replace. Same as -Dcassandra.replace_node in cssandra.") - , replace_token(this, "replace_token", value_status::Used, "", "The tokens of the node to replace. Same as -Dcassandra.replace_token in cassandra.") , replace_address(this, "replace_address", value_status::Used, "", "The listen_address or broadcast_address of the dead node to replace. Same as -Dcassandra.replace_address.") , replace_address_first_boot(this, "replace_address_first_boot", value_status::Used, "", "Like replace_address option, but if the node has been bootstrapped successfully it will be ignored. Same as -Dcassandra.replace_address_first_boot.") , override_decommission(this, "override_decommission", value_status::Used, false, "Set true to force a decommissioned node to join the cluster") diff --git a/db/config.hh b/db/config.hh index a948a18475..8d602eb507 100644 --- a/db/config.hh +++ b/db/config.hh @@ -294,8 +294,6 @@ public: named_value consistent_rangemovement; named_value join_ring; named_value load_ring_state; - named_value replace_node; - named_value replace_token; named_value replace_address; named_value replace_address_first_boot; named_value override_decommission; diff --git a/service/storage_service.cc b/service/storage_service.cc index efbd1d5c84..51c9d89ce5 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -194,37 +194,6 @@ bool storage_service::is_auto_bootstrap() const { return _db.local().get_config().auto_bootstrap(); } -std::unordered_set storage_service::get_replace_tokens() { - std::unordered_set ret; - std::unordered_set tokens; - auto tokens_string = _db.local().get_config().replace_token(); - try { - boost::split(tokens, tokens_string, boost::is_any_of(sstring(","))); - } catch (...) { - throw std::runtime_error(format("Unable to parse replace_token={}", tokens_string)); - } - tokens.erase(""); - for (auto token_string : tokens) { - auto token = dht::token::from_sstring(token_string); - ret.insert(token); - } - return ret; -} - -std::optional storage_service::get_replace_node() { - auto replace_node = _db.local().get_config().replace_node(); - if (replace_node.empty()) { - return std::nullopt; - } - try { - return utils::UUID(replace_node); - } catch (...) { - auto msg = format("Unable to parse {} as host-id", replace_node); - slogger.error("{}", msg); - throw std::runtime_error(msg); - } -} - bool storage_service::is_first_node() { if (_db.local().is_replacing()) { return false; @@ -280,9 +249,7 @@ void storage_service::prepare_to_join( throw std::runtime_error(msg); } } - if (get_replace_tokens().size() > 0 || get_replace_node()) { - throw std::runtime_error("Replace method removed; use replace_address instead"); - } + bool replacing_a_node_with_same_ip = false; bool replacing_a_node_with_diff_ip = false; auto tmlock = std::make_unique(get_token_metadata_lock().get0()); diff --git a/service/storage_service.hh b/service/storage_service.hh index 188f47b50b..711194caca 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -375,9 +375,6 @@ private: void run_replace_ops(); void run_bootstrap_ops(); - std::unordered_set get_replace_tokens(); - std::optional get_replace_node(); - public: future is_initialized();