storage_service: Wait for gossip to settle only if do_bind is set

In commit 71bf757b2c, we call
wait_for_gossip_to_settle() which takes some time to complete in
storage_service::prepare_to_join().

In tests/cql_query_test calls init_server with do_bind == false which in
turn calls storage_service::prepare_to_join(). Since in the test, there
is only one node, there is no point to wait for gossip to settle.

To make the cql_query_test fast again, do not call
wait_for_gossip_to_settle if do_bind is false.

Before this patch, cql_query_test takes forever to complete.
After it takes 10s.

Ref #4289.

Tests: tests/cql_query_test
Message-Id: <3ae509e0a011ae30eef3f383c6a107e194e0e243.1553147332.git.asias@scylladb.com>
(cherry picked from commit c0f744b407)
This commit is contained in:
Asias He
2019-03-21 13:49:03 +08:00
committed by Avi Kivity
parent 75a737c958
commit c537b3dd8e

View File

@@ -447,7 +447,9 @@ void storage_service::prepare_to_join(std::vector<inet_address> loaded_endpoints
BatchlogManager.instance.start();
#endif
// Wait for gossip to settle so that the fetures will be enabled
gms::get_local_gossiper().wait_for_gossip_to_settle().get();
if (do_bind) {
gms::get_local_gossiper().wait_for_gossip_to_settle().get();
}
}
// Runs inside seastar::async context