system distributed keyspace: Start sharded service erarlier

The constructors just set up the references, real start happens in .start()
so it is safe to do this early. This helps not carrying migration manager
and query processor down the storage service cluster joining code.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2020-10-07 21:37:42 +03:00
parent 021b905773
commit 8989021dc3
3 changed files with 4 additions and 1 deletions

View File

@@ -1071,6 +1071,8 @@ int main(int ac, char** av) {
gms::stop_gossiping().get();
});
sys_dist_ks.start(std::ref(qp), std::ref(mm)).get();
ss.init_server().get();
sst_format_selector.sync();
ss.join_cluster().get();

View File

@@ -391,7 +391,6 @@ void storage_service::prepare_to_join(
void storage_service::maybe_start_sys_dist_ks() {
supervisor::notify("starting system distributed keyspace");
_sys_dist_ks.start(std::ref(cql3::get_query_processor()), std::ref(service::get_migration_manager())).get();
_sys_dist_ks.invoke_on_all(&db::system_distributed_keyspace::start).get();
}

View File

@@ -561,6 +561,8 @@ public:
db::system_keyspace::init_local_cache().get();
auto stop_local_cache = defer([] { db::system_keyspace::deinit_local_cache().get(); });
sys_dist_ks.start(std::ref(qp), std::ref(mm)).get();
service::get_local_storage_service().init_server(service::bind_messaging_port(false)).get();
service::get_local_storage_service().join_cluster().get();