From 269ea7f81bf9cb1e278681ee2d389bc49fc50273 Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 18 Nov 2015 15:55:16 +0800 Subject: [PATCH] storage_service: Enable is_ready_for_bootstrap in join_token_ring The goal is to make sure our schema matches with other nodes in the cluster. --- service/storage_service.cc | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index 780d22ead8..0524c67a77 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -244,15 +244,12 @@ void storage_service::join_token_ring(int delay) { } sleep(std::chrono::seconds(1)).get(); } -#if 0 // if our schema hasn't matched yet, keep sleeping until it does // (post CASSANDRA-1391 we don't expect this to be necessary very often, but it doesn't hurt to be careful) - while (!MigrationManager.isReadyForBootstrap()) - { + while (!get_local_migration_manager().is_ready_for_bootstrap()) { set_mode(mode::JOINING, "waiting for schema information to complete", true); - Uninterruptibles.sleepUninterruptibly(1, TimeUnit.SECONDS); + sleep(std::chrono::seconds(1)).get(); } -#endif set_mode(mode::JOINING, "schema complete, ready to bootstrap", true); set_mode(mode::JOINING, "waiting for pending range calculation", true); get_local_pending_range_calculator_service().block_until_finished().get();