From 5b170d1ffe4233c98d0cb0b01452889b3df892a4 Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 21 Oct 2015 14:51:49 +0800 Subject: [PATCH] storage_service: Complete handle_state_removing Implement #if 0'ed code. --- service/storage_service.cc | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index b57903f952..146333ca71 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -627,18 +627,24 @@ void storage_service::handle_state_removing(inet_address endpoint, std::vectorget_application_state(application_state::REMOVAL_COORDINATOR); + assert(value); + std::vector coordinator; + boost::split(coordinator, value->value, boost::is_any_of(sstring(versioned_value::DELIMITER_STR))); + assert(coordinator.size() == 2); + UUID host_id(coordinator[1]); // grab any data we are now responsible for and notify responsible node - restoreReplicaCount(endpoint, _token_metadata.getEndpointForHostId(hostId)); -#endif + auto ep = _token_metadata.get_endpoint_for_host_id(host_id); + assert(ep); + restore_replica_count(endpoint, ep.value()).get(); } } else { // now that the gossiper has told us about this nonexistent member, notify the gossiper to remove it if (sstring(gms::versioned_value::REMOVED_TOKEN) == pieces[0]) {