mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
db,view: remove duplicate entries from the list of target endpoints
If a list of target endpoints for sending view updates contains
duplicates, it results in benign (but annoying) broken promise
errors happening due to duplicated write response handlers being
instantiated for a single endpoint.
In order to avoid such errors, target remote endpoints are deduplicated
from the list of pending endpoints.
A similar issue (#5459) solved the case for duplicated local endpoints,
but that didn't solve the general case.
Fixes #7572
Closes #7641
(cherry picked from commit c0d72b4491)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user