From dbca327b469184ea19d0b11f15f323dcdea8b26b Mon Sep 17 00:00:00 2001 From: Kamil Braun Date: Fri, 4 Oct 2019 19:07:51 +0200 Subject: [PATCH] storage_service: remove storage_service::_is_bootstrap_mode. The flag did nothing. It was used in one place to check if there's a bug, but it can easily by proven by reading the code that the check would never pass. --- dht/boot_strapper.cc | 4 +--- service/storage_service.cc | 6 ------ service/storage_service.hh | 11 ----------- 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/dht/boot_strapper.cc b/dht/boot_strapper.cc index be24b9119e..4eabe492b9 100644 --- a/dht/boot_strapper.cc +++ b/dht/boot_strapper.cc @@ -62,9 +62,7 @@ future<> boot_strapper::bootstrap() { return streamer->add_ranges(keyspace_name, ranges); }).then([this, streamer] { _abort_source.check(); - return streamer->stream_async().then([streamer] () { - service::get_local_storage_service().finish_bootstrapping(); - }).handle_exception([streamer] (std::exception_ptr eptr) { + return streamer->stream_async().handle_exception([streamer] (std::exception_ptr eptr) { blogger.warn("Error during bootstrap: {}", eptr); return make_exception_future<>(std::move(eptr)); }); diff --git a/service/storage_service.cc b/service/storage_service.cc index 60d2814667..0cc05bea14 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -715,11 +715,6 @@ void storage_service::join_token_ring(int delay) { db::system_keyspace::update_tokens(_bootstrap_tokens).get(); bootstrap(); // bootstrap will block until finished - if (_is_bootstrap_mode) { - auto err = format("We are not supposed in bootstrap mode any more"); - slogger.warn("{}", err); - throw std::runtime_error(err); - } } else { maybe_start_sys_dist_ks(); size_t num_tokens = _db.local().get_config().num_tokens(); @@ -818,7 +813,6 @@ void storage_service::mark_existing_views_as_built() { // Runs inside seastar::async context void storage_service::bootstrap() { - _is_bootstrap_mode = true; if (!db().local().is_replacing()) { // Wait until we know tokens of existing node before announcing join status. _gossiper.wait_for_range_setup().get(); diff --git a/service/storage_service.hh b/service/storage_service.hh index 984a119efc..3a480390ca 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -259,9 +259,6 @@ private: std::optional _removing_node; - /* Are we starting this node in bootstrap mode? */ - bool _is_bootstrap_mode; - bool _initialized; bool _joined = false; @@ -347,10 +344,6 @@ public: sstables::sstable_version_types sstables_format() const { return _sstables_format; } void enable_all_features(); - void finish_bootstrapping() { - _is_bootstrap_mode = false; - } - void set_gossip_tokens(const std::unordered_set& local_tokens); #if 0 @@ -554,10 +547,6 @@ private: void bootstrap(); public: - bool is_bootstrap_mode() { - return _is_bootstrap_mode; - } - #if 0 public TokenMetadata getTokenMetadata()