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
This commit is contained in:
Gleb Natapov
2024-02-21 13:13:19 +02:00
committed by Kamil Braun
parent 9ee728dab9
commit fe5853aacc

View File

@@ -6227,6 +6227,11 @@ future<sstring> 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")) {