diff --git a/service/storage_service.cc b/service/storage_service.cc index 063816466b..b4171e2adb 100644 --- a/service/storage_service.cc +++ b/service/storage_service.cc @@ -1914,6 +1914,17 @@ void storage_service::send_replication_notification(inet_address remote) { #endif } +void storage_service::confirm_replication(inet_address node) { + // replicatingNodes can be empty in the case where this node used to be a removal coordinator, + // but restarted before all 'replication finished' messages arrived. In that case, we'll + // still go ahead and acknowledge it. + if (!_replicating_nodes.empty()) { + _replicating_nodes.erase(node); + } else { + logger.info("Received unexpected REPLICATION_FINISHED message from {}. Was this node recently a removal coordinator?", node); + } +} + // Runs inside seastar::async context void storage_service::leave_ring() { db::system_keyspace::set_bootstrap_state(db::system_keyspace::bootstrap_state::NEEDS_BOOTSTRAP).get(); diff --git a/service/storage_service.hh b/service/storage_service.hh index 4918905660..b17e92acb4 100644 --- a/service/storage_service.hh +++ b/service/storage_service.hh @@ -808,6 +808,9 @@ private: #endif } +public: + void confirm_replication(inet_address node); + private: /** @@ -816,6 +819,7 @@ private: * @param remote node to send notification to */ void send_replication_notification(inet_address remote); + /** * Called when an endpoint is removed from the ring. This function checks * whether this node becomes responsible for new ranges as a @@ -2166,22 +2170,6 @@ public: */ future<> remove_node(sstring host_id_string); -#if 0 - public void confirmReplication(InetAddress node) - { - // replicatingNodes can be empty in the case where this node used to be a removal coordinator, - // but restarted before all 'replication finished' messages arrived. In that case, we'll - // still go ahead and acknowledge it. - if (!replicatingNodes.isEmpty()) - { - replicatingNodes.remove(node); - } - else - { - logger.info("Received unexpected REPLICATION_FINISHED message from {}. Was this node recently a removal coordinator?", node); - } - } -#endif future get_operation_mode(); future is_starting();