storage_service: Drop block_until_update_pending_ranges_finished
It is a legacy API from c*. Since we can wait for the update_pending_ranges to complete, we can wait for it directly instead of calling block_until_update_pending_ranges_finished to do so. Also, change do_update_pending_ranges to be private. Message-Id: <ac79b2879ec08fdcd3b2278ff68962cc71492f12.1458040608.git.asias@scylladb.com>
This commit is contained in:
@@ -260,7 +260,7 @@ void storage_service::join_token_ring(int delay) {
|
||||
}
|
||||
set_mode(mode::JOINING, "schema complete, ready to bootstrap", true);
|
||||
set_mode(mode::JOINING, "waiting for pending range calculation", true);
|
||||
block_until_update_pending_ranges_finished().get();
|
||||
update_pending_ranges().get();
|
||||
set_mode(mode::JOINING, "calculation complete, ready to bootstrap", true);
|
||||
logger.debug("... got ring + schema info");
|
||||
|
||||
@@ -287,7 +287,7 @@ void storage_service::join_token_ring(int delay) {
|
||||
set_mode(mode::JOINING, "waiting for schema information to complete", true);
|
||||
sleep(std::chrono::seconds(1)).get();
|
||||
}
|
||||
block_until_update_pending_ranges_finished().get();
|
||||
update_pending_ranges().get();
|
||||
}
|
||||
logger.info("Checking bootstrapping/leaving/moving nodes: ok");
|
||||
|
||||
@@ -2844,7 +2844,7 @@ future<> storage_service::move(token new_token) {
|
||||
|
||||
auto keyspaces_to_process = ss._db.local().get_non_system_keyspaces();
|
||||
|
||||
ss.block_until_update_pending_ranges_finished().get();
|
||||
ss.update_pending_ranges().get();
|
||||
|
||||
// checking if data is moving to this node
|
||||
for (auto keyspace_name : keyspaces_to_process) {
|
||||
@@ -2914,15 +2914,6 @@ future<> storage_service::update_pending_ranges() {
|
||||
});
|
||||
}
|
||||
|
||||
future<> storage_service::block_until_update_pending_ranges_finished() {
|
||||
// We want to be sure the job we're blocking for is actually finished and we can't trust the TPE's active job count
|
||||
return smp::submit_to(0, [] {
|
||||
return do_until(
|
||||
[] { return !(get_local_storage_service()._update_jobs > 0); },
|
||||
[] { return sleep(std::chrono::milliseconds(100)); });
|
||||
});
|
||||
}
|
||||
|
||||
future<> storage_service::keyspace_changed(const sstring& ks_name) {
|
||||
// Update pending ranges since keyspace can be changed after we calculate pending ranges.
|
||||
return update_pending_ranges().handle_exception([ks_name] (auto ep) {
|
||||
|
||||
@@ -131,10 +131,12 @@ public:
|
||||
void init_messaging_service();
|
||||
void uninit_messaging_service();
|
||||
|
||||
future<> keyspace_changed(const sstring& ks_name);
|
||||
private:
|
||||
void do_update_pending_ranges();
|
||||
|
||||
public:
|
||||
future<> keyspace_changed(const sstring& ks_name);
|
||||
future<> update_pending_ranges();
|
||||
future<> block_until_update_pending_ranges_finished();
|
||||
|
||||
const locator::token_metadata& get_token_metadata() const {
|
||||
return _token_metadata;
|
||||
|
||||
Reference in New Issue
Block a user