From d3120b3c2f490fd82fcf94d922dffa71a554ef86 Mon Sep 17 00:00:00 2001 From: Asias He Date: Wed, 21 Oct 2015 14:50:08 +0800 Subject: [PATCH] storage_service: Complete is_replacing logic in handle_state_normal --- service/storage_service.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/service/storage_service.cc b/service/storage_service.cc index 8ce0551308..8aac3fb48d 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -453,10 +453,10 @@ void storage_service::handle_state_normal(inet_address endpoint) { if (gossiper.uses_host_id(endpoint)) { auto host_id = gossiper.get_host_id(endpoint); auto existing = _token_metadata.get_endpoint_for_host_id(host_id); - // if (DatabaseDescriptor.isReplacing() && - // Gossiper.instance.getEndpointStateForEndpoint(DatabaseDescriptor.getReplaceAddress()) != null && - // (hostId.equals(Gossiper.instance.getHostId(DatabaseDescriptor.getReplaceAddress())))) { - if (false) { + if (is_replacing() && + get_replace_address() && + gossiper.get_endpoint_state_for_endpoint(get_replace_address().value()) && + (host_id == gossiper.get_host_id(get_replace_address().value()))) { logger.warn("Not updating token metadata for {} because I am replacing it", endpoint); } else { if (existing && *existing != endpoint) {