From acc035b504f87116c36628d15e65705d148eb5af Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Sun, 28 May 2023 16:20:21 +0300 Subject: [PATCH] storage_service: do not allow override_decommission flag if consistent cluster management is enabled If consistent cluster management is enabled it is not possible to restart decommissioned node since it will not be part of the grouup0. --- db/config.cc | 2 +- service/storage_service.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/config.cc b/db/config.cc index ce47e93b89..f23b819b7b 100644 --- a/db/config.cc +++ b/db/config.cc @@ -837,7 +837,7 @@ db::config::config(std::shared_ptr exts) , replace_address(this, "replace_address", value_status::Used, "", "[[deprecated]] 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, "", "[[deprecated]] Like replace_address option, but if the node has been bootstrapped successfully it will be ignored. Same as -Dcassandra.replace_address_first_boot.") , ignore_dead_nodes_for_replace(this, "ignore_dead_nodes_for_replace", value_status::Used, "", "List dead nodes to ignore for replace operation using a comma-separated list of host IDs. E.g., scylla --ignore-dead-nodes-for-replace 8d5ed9f4-7764-4dbd-bad8-43fddce94b7c,125ed9f4-7777-1dbn-mac8-43fddce9123e") - , override_decommission(this, "override_decommission", value_status::Used, false, "Set true to force a decommissioned node to join the cluster") + , override_decommission(this, "override_decommission", value_status::Used, false, "Set true to force a decommissioned node to join the cluster (cannot be set if consistent-cluster-management is enabled") , enable_repair_based_node_ops(this, "enable_repair_based_node_ops", liveness::LiveUpdate, value_status::Used, true, "Set true to use enable repair based node operations instead of streaming based") , allowed_repair_based_node_ops(this, "allowed_repair_based_node_ops", liveness::LiveUpdate, value_status::Used, "replace,removenode,rebuild,bootstrap,decommission", "A comma separated list of node operations which are allowed to enable repair based node operations. The operations can be bootstrap, replace, removenode, decommission and rebuild") , ring_delay_ms(this, "ring_delay_ms", value_status::Used, 30 * 1000, "Time a node waits to hear from other nodes before joining the ring in milliseconds. Same as -Dcassandra.ring_delay_ms in cassandra.") diff --git a/service/storage_service.cc b/service/storage_service.cc index e31c9c5eec..09d79b0a79 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1562,11 +1562,11 @@ future<> storage_service::join_token_ring(cdc::generation_service& cdc_gen_servi std::optional cdc_gen_id; if (_sys_ks.local().was_decommissioned()) { - if (_db.local().get_config().override_decommission()) { + if (_db.local().get_config().override_decommission() && !_db.local().get_config().consistent_cluster_management()) { slogger.warn("This node was decommissioned, but overriding by operator request."); co_await _sys_ks.local().set_bootstrap_state(db::system_keyspace::bootstrap_state::COMPLETED); } else { - auto msg = sstring("This node was decommissioned and will not rejoin the ring unless override_decommission=true has been set," + auto msg = sstring("This node was decommissioned and will not rejoin the ring unless override_decommission=true has been set and consistent cluster management is not in use," "or all existing data is removed and the node is bootstrapped again"); slogger.error("{}", msg); throw std::runtime_error(msg);