mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-23 16:22:15 +00:00
config: Remove unused replacing options
The --replace-token and --replace-node were added some time ago, but have never been used since then, just parsed and immediatelly aborted. Signed-off-by: Pavel Emelyanov <xemul@scylladb.com> Message-Id: <20210930102222.16294-1-xemul@scylladb.com>
This commit is contained in:
committed by
Avi Kivity
parent
79de151158
commit
bbcf671276
@@ -740,8 +740,6 @@ db::config::config(std::shared_ptr<db::extensions> 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")
|
||||
|
||||
@@ -294,8 +294,6 @@ public:
|
||||
named_value<bool> consistent_rangemovement;
|
||||
named_value<bool> join_ring;
|
||||
named_value<bool> load_ring_state;
|
||||
named_value<sstring> replace_node;
|
||||
named_value<sstring> replace_token;
|
||||
named_value<sstring> replace_address;
|
||||
named_value<sstring> replace_address_first_boot;
|
||||
named_value<bool> override_decommission;
|
||||
|
||||
@@ -194,37 +194,6 @@ bool storage_service::is_auto_bootstrap() const {
|
||||
return _db.local().get_config().auto_bootstrap();
|
||||
}
|
||||
|
||||
std::unordered_set<token> storage_service::get_replace_tokens() {
|
||||
std::unordered_set<token> ret;
|
||||
std::unordered_set<sstring> 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<UUID> 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<token_metadata_lock>(get_token_metadata_lock().get0());
|
||||
|
||||
@@ -375,9 +375,6 @@ private:
|
||||
void run_replace_ops();
|
||||
void run_bootstrap_ops();
|
||||
|
||||
std::unordered_set<token> get_replace_tokens();
|
||||
std::optional<utils::UUID> get_replace_node();
|
||||
|
||||
public:
|
||||
future<bool> is_initialized();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user