diff --git a/db/view/view.cc b/db/view/view.cc index 323b2fded1..5ccc8f23ad 100644 --- a/db/view/view.cc +++ b/db/view/view.cc @@ -1241,6 +1241,14 @@ future<> mutate_MV( } } } + // It's still possible that a target endpoint is dupliated in the remote endpoints list, + // so let's get rid of the duplicate if it exists + if (target_endpoint) { + auto remote_it = std::find(remote_endpoints.begin(), remote_endpoints.end(), *target_endpoint); + if (remote_it != remote_endpoints.end()) { + remote_endpoints.erase(remote_it); + } + } if (target_endpoint && *target_endpoint == my_address) { ++stats.view_updates_pushed_local;