messaging, main, gossiper: Move listening start into main

Before preparing the cluster join process the messaging should be
put into listening state. Right now it's done "on-demand" by the
call to the do_shadow_round(), also there's a safety call in the
start_gossiping(). Tests, however, should not start listening, so
the do_bind boolean exists and is passed all the way around.

Make the main() code explicitly call the messaging.start_listen()
and leave tests without it. This change makes messaging start
listening a bit earlier, but in between these old and new places
there's nothing that needs messaging to stay deaf.

As the do_bind becomes useless, the wait_for_gossip_to_settle() is
also moved into main.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2021-09-17 14:54:34 +03:00
parent f644eb1cf7
commit ca316f32f0
3 changed files with 5 additions and 9 deletions

View File

@@ -470,10 +470,6 @@ future<> gossiper::init_messaging(bind_messaging_port do_bind) {
}
_ms_registered = true;
if (do_bind) {
return _messaging.start_listen();
}
return make_ready_future<>();
}

View File

@@ -1172,10 +1172,15 @@ int main(int ac, char** av) {
mm_notifier.local().unregister_listener(&ss.local()).get();
});
with_scheduling_group(maintenance_scheduling_group, [&] {
return messaging.invoke_on_all(&netw::messaging_service::start_listen);
}).get();
with_scheduling_group(maintenance_scheduling_group, [&] {
return ss.local().init_server();
}).get();
gossiper.local().wait_for_gossip_to_settle().get();
sst_format_selector.sync();
with_scheduling_group(maintenance_scheduling_group, [&] {

View File

@@ -398,11 +398,6 @@ void storage_service::prepare_to_join(
gossip_sharder().get();
// gossip Schema.emptyVersion forcing immediate check for schema updates (see MigrationManager#maybeScheduleSchemaPull)
// Wait for gossip to settle so that the fetures will be enabled
if (do_bind) {
_gossiper.wait_for_gossip_to_settle().get();
}
}
void storage_service::maybe_start_sys_dist_ks() {