mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
gossiper: remove code related to advertising REMOVING_TOKEN state
Apparently it was needed for removetoken support which was deprecated in the ORIGIN already.
This commit is contained in:
@@ -1159,30 +1159,6 @@ future<> gossiper::replicate(inet_address ep, application_state key, const versi
|
||||
});
|
||||
}
|
||||
|
||||
future<> gossiper::advertise_removing(inet_address endpoint, locator::host_id host_id, locator::host_id local_host_id) {
|
||||
auto& state = get_endpoint_state(endpoint);
|
||||
// remember this node's generation
|
||||
auto generation = state.get_heart_beat_state().get_generation();
|
||||
logger.info("Removing host: {}", host_id);
|
||||
auto ring_delay = std::chrono::milliseconds(_gcfg.ring_delay_ms);
|
||||
logger.info("Sleeping for {}ms to ensure {} does not change", ring_delay.count(), endpoint);
|
||||
co_await sleep_abortable(ring_delay, _abort_source);
|
||||
// make sure it did not change
|
||||
auto& eps = get_endpoint_state(endpoint);
|
||||
if (eps.get_heart_beat_state().get_generation() != generation) {
|
||||
throw std::runtime_error(format("Endpoint {} generation changed while trying to remove it", endpoint));
|
||||
}
|
||||
|
||||
// update the other node's generation to mimic it as if it had changed it itself
|
||||
logger.info("Advertising removal for {}", endpoint);
|
||||
eps.update_timestamp(); // make sure we don't evict it too soon
|
||||
eps.get_heart_beat_state().force_newer_generation_unsafe();
|
||||
eps.add_application_state(application_state::STATUS, versioned_value::removing_nonlocal(host_id));
|
||||
eps.add_application_state(application_state::REMOVAL_COORDINATOR, versioned_value::removal_coordinator(local_host_id));
|
||||
_endpoint_state_map[endpoint] = eps;
|
||||
co_await replicate(endpoint, eps);
|
||||
}
|
||||
|
||||
future<> gossiper::advertise_token_removed(inet_address endpoint, locator::host_id host_id) {
|
||||
auto& eps = get_endpoint_state(endpoint);
|
||||
eps.update_timestamp(); // make sure we don't evict it too soon
|
||||
|
||||
@@ -324,16 +324,6 @@ private:
|
||||
void make_random_gossip_digest(utils::chunked_vector<gossip_digest>& g_digests);
|
||||
|
||||
public:
|
||||
/**
|
||||
* This method will begin removing an existing endpoint from the cluster by spoofing its state
|
||||
* This should never be called unless this coordinator has had 'removenode' invoked
|
||||
*
|
||||
* @param endpoint - the endpoint being removed
|
||||
* @param host_id - the ID of the host being removed
|
||||
* @param local_host_id - my own host ID for replication coordination
|
||||
*/
|
||||
future<> advertise_removing(inet_address endpoint, locator::host_id host_id, locator::host_id local_host_id);
|
||||
|
||||
/**
|
||||
* Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN
|
||||
* This should only be called after advertise_removing
|
||||
|
||||
@@ -157,11 +157,6 @@ public:
|
||||
return versioned_value(make_cdc_generation_id_string(gen_id));
|
||||
}
|
||||
|
||||
static versioned_value removing_nonlocal(const locator::host_id& host_id) {
|
||||
return versioned_value(sstring(REMOVING_TOKEN) +
|
||||
sstring(DELIMITER_STR) + host_id.to_sstring());
|
||||
}
|
||||
|
||||
static versioned_value removed_nonlocal(const locator::host_id& host_id, int64_t expire_time) {
|
||||
return versioned_value(sstring(REMOVED_TOKEN) + sstring(DELIMITER_STR) +
|
||||
host_id.to_sstring() + sstring(DELIMITER_STR) + to_sstring(expire_time));
|
||||
|
||||
Reference in New Issue
Block a user