diff --git a/api/storage_service.cc b/api/storage_service.cc index 29b6a77076..d1a2966a2f 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -783,17 +783,13 @@ rest_cleanup_all(http_context& ctx, sharded& ss, std:: apilog.info("cleanup_all global={}", global); - auto done = !global ? false : co_await ss.invoke_on(0, [] (service::storage_service& ss) -> future { - if (!ss.is_topology_coordinator_enabled()) { - co_return false; - } - co_await ss.do_clusterwide_vnodes_cleanup(); - co_return true; - }); - if (done) { + if (global) { + co_await ss.invoke_on(0, [] (service::storage_service& ss) -> future<> { + co_return co_await ss.do_clusterwide_vnodes_cleanup(); + }); co_return json::json_return_type(0); } - // fall back to the local cleanup if topology coordinator is not enabled or local cleanup is requested + // fall back to the local cleanup if local cleanup is requested auto& db = ctx.db; auto& compaction_module = db.local().get_compaction_manager().get_task_manager_module(); auto task = co_await compaction_module.make_and_start_task({}, db); @@ -801,9 +797,7 @@ rest_cleanup_all(http_context& ctx, sharded& ss, std:: // Mark this node as clean co_await ss.invoke_on(0, [] (service::storage_service& ss) -> future<> { - if (ss.is_topology_coordinator_enabled()) { - co_await ss.reset_cleanup_needed(); - } + co_await ss.reset_cleanup_needed(); }); co_return json::json_return_type(0); @@ -814,9 +808,6 @@ future rest_reset_cleanup_needed(http_context& ctx, sharded& ss, std::unique_ptr req) { apilog.info("reset_cleanup_needed"); co_await ss.invoke_on(0, [] (service::storage_service& ss) { - if (!ss.is_topology_coordinator_enabled()) { - throw std::runtime_error("mark_node_as_clean is only supported when topology over raft is enabled"); - } return ss.reset_cleanup_needed(); }); co_return json_void(); diff --git a/service/storage_service.cc b/service/storage_service.cc index 87db33732b..d54c29156b 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -2837,10 +2837,6 @@ future<> storage_service::uninit_address_map() { return _gossiper.unregister_(_ip_address_updater); } -bool storage_service::is_topology_coordinator_enabled() const { - return raft_topology_change_enabled(); -} - future<> storage_service::join_cluster(sharded& proxy, start_hint_manager start_hm, gms::generation_type new_generation) { SCYLLA_ASSERT(this_shard_id() == 0); diff --git a/service/storage_service.hh b/service/storage_service.hh index 29bf6bfc5a..43a3e88c3c 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -488,7 +488,6 @@ public: future<> init_address_map(gms::gossip_address_map& address_map); future<> uninit_address_map(); - bool is_topology_coordinator_enabled() const; future<> drain_on_shutdown();