From c537b3dd8ef977aa3ea71b255482e4e62f58453a Mon Sep 17 00:00:00 2001 From: Asias He Date: Thu, 21 Mar 2019 13:49:03 +0800 Subject: [PATCH] storage_service: Wait for gossip to settle only if do_bind is set In commit 71bf757b2c8fb372bfd115ed00bf56069331d7cc, 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 c0f744b4077ad0ca314e2200f3fe947cdca4cd0e) --- service/storage_service.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index 4a3925ae8b..f4c5d79e5f 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -447,7 +447,9 @@ void storage_service::prepare_to_join(std::vector 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