From d7cccec97fc1a3ddedd0e58efe39feb2e4a61e84 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 26 Mar 2021 17:01:20 +0300 Subject: [PATCH] system_distributed_keyspace: Stop it in main.cc It's now stopped in drain_on_shutdown, but since its stop() method is a noop, it doesn't matter where it is. Keeping it in main.cc next to related start brings drain_on_shutdown() closer to drain() and the whole thing closer to the Ideal start-stop sequence. Signed-off-by: Pavel Emelyanov --- main.cc | 3 +++ service/storage_service.cc | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.cc b/main.cc index 9e11dcab5e..83cb8f9dc5 100644 --- a/main.cc +++ b/main.cc @@ -1137,6 +1137,9 @@ int main(int ac, char** av) { }); sys_dist_ks.start(std::ref(qp), std::ref(mm), std::ref(proxy)).get(); + auto stop_sdks = defer_verbose_shutdown("system distributed keyspace", [] { + sys_dist_ks.invoke_on_all(&db::system_distributed_keyspace::stop).get(); + }); // Register storage_service to migration_notifier so we can update // pending ranges when keyspace is chagned diff --git a/service/storage_service.cc b/service/storage_service.cc index 52c713c0ad..b7b6d52752 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1334,9 +1334,6 @@ future<> storage_service::drain_on_shutdown() { tracing::tracing::tracing_instance().stop().get(); slogger.info("Drain on shutdown: tracing is stopped"); - ss._sys_dist_ks.invoke_on_all(&db::system_distributed_keyspace::stop).get(); - slogger.info("Drain on shutdown: system distributed keyspace stopped"); - get_storage_proxy().invoke_on_all([] (storage_proxy& local_proxy) mutable { auto& ss = service::get_local_storage_service(); return ss.unregister_subscriber(&local_proxy).finally([&local_proxy] {