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 <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2021-03-26 17:01:20 +03:00
parent 5456174d69
commit d7cccec97f
2 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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] {