From fe5853aacc34c0d2be2cfcbf859f5bb3ddab5d51 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 21 Feb 2024 13:13:19 +0200 Subject: [PATCH] storage_service: disable removenode --force in raft mode and deprecate it for gossiper mode removenode --force is an unsafe operation and does not even make sense with topology over raft. This patch disables it if raft is enabled and prints a deprecation note otherwise. We already have a PR to remove it (https://github.com/scylladb/scylladb/pull/15834), but it was decided there that a deprecation period is needed for legacy use case. Fixes: scylladb/scylladb#16293 --- service/storage_service.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/storage_service.cc b/service/storage_service.cc index 69e5ab94b9..00aa44762a 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -6227,6 +6227,11 @@ future storage_service::get_removal_status() { } future<> storage_service::force_remove_completion() { + if (raft_topology_change_enabled()) { + return make_exception_future<>(std::runtime_error("The unsafe nodetool removenode force is not supported anymore")); + } + + slogger.warn("The unsafe nodetool removenode force is deprecated and will not be supported in future releases"); return run_with_no_api_lock([] (storage_service& ss) -> future<> { while (!ss._operation_in_progress.empty()) { if (ss._operation_in_progress != sstring("removenode")) {