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.
This commit is contained in:
Kamil Braun
2019-10-04 19:07:51 +02:00
parent b757a19f84
commit dbca327b46
3 changed files with 1 additions and 20 deletions

View File

@@ -62,9 +62,7 @@ future<> boot_strapper::bootstrap() {
return streamer->add_ranges(keyspace_name, ranges); return streamer->add_ranges(keyspace_name, ranges);
}).then([this, streamer] { }).then([this, streamer] {
_abort_source.check(); _abort_source.check();
return streamer->stream_async().then([streamer] () { return streamer->stream_async().handle_exception([streamer] (std::exception_ptr eptr) {
service::get_local_storage_service().finish_bootstrapping();
}).handle_exception([streamer] (std::exception_ptr eptr) {
blogger.warn("Error during bootstrap: {}", eptr); blogger.warn("Error during bootstrap: {}", eptr);
return make_exception_future<>(std::move(eptr)); return make_exception_future<>(std::move(eptr));
}); });

View File

@@ -715,11 +715,6 @@ void storage_service::join_token_ring(int delay) {
db::system_keyspace::update_tokens(_bootstrap_tokens).get(); db::system_keyspace::update_tokens(_bootstrap_tokens).get();
bootstrap(); bootstrap();
// bootstrap will block until finished // 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 { } else {
maybe_start_sys_dist_ks(); maybe_start_sys_dist_ks();
size_t num_tokens = _db.local().get_config().num_tokens(); 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 // Runs inside seastar::async context
void storage_service::bootstrap() { void storage_service::bootstrap() {
_is_bootstrap_mode = true;
if (!db().local().is_replacing()) { if (!db().local().is_replacing()) {
// Wait until we know tokens of existing node before announcing join status. // Wait until we know tokens of existing node before announcing join status.
_gossiper.wait_for_range_setup().get(); _gossiper.wait_for_range_setup().get();

View File

@@ -259,9 +259,6 @@ private:
std::optional<inet_address> _removing_node; std::optional<inet_address> _removing_node;
/* Are we starting this node in bootstrap mode? */
bool _is_bootstrap_mode;
bool _initialized; bool _initialized;
bool _joined = false; bool _joined = false;
@@ -347,10 +344,6 @@ public:
sstables::sstable_version_types sstables_format() const { return _sstables_format; } sstables::sstable_version_types sstables_format() const { return _sstables_format; }
void enable_all_features(); void enable_all_features();
void finish_bootstrapping() {
_is_bootstrap_mode = false;
}
void set_gossip_tokens(const std::unordered_set<dht::token>& local_tokens); void set_gossip_tokens(const std::unordered_set<dht::token>& local_tokens);
#if 0 #if 0
@@ -554,10 +547,6 @@ private:
void bootstrap(); void bootstrap();
public: public:
bool is_bootstrap_mode() {
return _is_bootstrap_mode;
}
#if 0 #if 0
public TokenMetadata getTokenMetadata() public TokenMetadata getTokenMetadata()