storage_service: Complete is_replacing logic in handle_state_normal

This commit is contained in:
Asias He
2015-10-21 14:50:08 +08:00
parent 434a9e211e
commit d3120b3c2f

View File

@@ -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) {