mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
storage_service: Implement start_leaving
This commit is contained in:
@@ -1455,7 +1455,7 @@ future<> storage_service::decommission() {
|
||||
}
|
||||
|
||||
logger.debug("DECOMMISSIONING");
|
||||
// FIXME: startLeaving();
|
||||
start_leaving().get();
|
||||
// FIXME: long timeout = Math.max(RING_DELAY, BatchlogManager.instance.getBatchlogTimeout());
|
||||
long timeout = get_ring_delay();
|
||||
set_mode(mode::LEAVING, sprint("sleeping %s ms for batch processing and pending range setup", timeout), true);
|
||||
@@ -2019,4 +2019,11 @@ future<streaming::stream_state> storage_service::stream_hints() {
|
||||
}
|
||||
}
|
||||
|
||||
future<> storage_service::start_leaving() {
|
||||
auto& gossiper = gms::get_local_gossiper();
|
||||
gossiper.add_local_application_state(application_state::STATUS, value_factory.leaving(get_local_tokens()));
|
||||
_token_metadata.add_leaving_endpoint(get_broadcast_address());
|
||||
return get_local_pending_range_calculator_service().update();
|
||||
}
|
||||
|
||||
} // namespace service
|
||||
|
||||
@@ -1878,21 +1878,15 @@ public:
|
||||
FBUtilities.sortSampledKeys(keys, range);
|
||||
return keys;
|
||||
}
|
||||
|
||||
/**
|
||||
* Broadcast leaving status and update local _token_metadata accordingly
|
||||
*/
|
||||
private void startLeaving()
|
||||
{
|
||||
Gossiper.instance.addLocalApplicationState(ApplicationState.STATUS, valueFactory.leaving(getLocalTokens()));
|
||||
_token_metadata.addLeavingEndpoint(FBUtilities.getBroadcastAddress());
|
||||
PendingRangeCalculatorService.instance.update();
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
future<> decommission();
|
||||
|
||||
private:
|
||||
/**
|
||||
* Broadcast leaving status and update local _token_metadata accordingly
|
||||
*/
|
||||
future<> start_leaving();
|
||||
void leave_ring();
|
||||
void unbootstrap();
|
||||
future<streaming::stream_state> stream_hints();
|
||||
|
||||
Reference in New Issue
Block a user