client-routes: preserve partial route state#848
Closed
dkropachev wants to merge 1 commit intomasterfrom
Closed
Conversation
Partial CLIENT_ROUTES_CHANGE handling must not treat filtered event entries as affected route state. Limit merge invalidation to configured event pairs so unrelated connection IDs cannot drop cached proxy routes. For same-host partial updates, fetch all configured connection IDs for affected hosts. This lets the route store keep the currently preferred proxy route when it is still present instead of switching because the partial event omitted it. Also keep ClientRoutesEndPoint identity port-aware and sortable when original_port is missing. Fixes #846 Refs #813
278d66e to
d30b6d4
Compare
Collaborator
Author
|
Closed in favor of #853 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #846
Refs #813
Summary
CLIENT_ROUTES_CHANGEmerge invalidation to host IDs from configured event pairsconnection_ids for affected hosts so the current preferred proxy route can be retainedoriginal_portinClientRoutesEndPointidentity and make endpoint ordering tolerate missing portsWhy
cassandra/client_routes.pychangedhandle_client_routes_change()receives parallelconnection_idsandhost_idsfrom the server. The driver filters those pairs to configuredconnection_ids before queryingsystem.client_routes.The first bug was that the query used the filtered pairs, but
_RouteStore.merge()was told that every host ID from the original event was affected. In a mixed event, an unrelatedconnection_idcould therefore causemerge()to delete a valid cached route even though that entry was filtered out and never refreshed. The fix passes only host IDs from filtered configured pairs asaffected_host_ids.The second bug was same-host stickiness. The route store keeps one preferred route per host. If the host currently used proxy
A, but a partial event arrived for configured proxyB, the old query fetched onlyB._select_preferred_routes()could not see thatAstill existed, so it could switch away from the preferred route. The fix queries all configuredconnection_ids for affected hosts, so existing preferred routes are preserved when still present.Risk
Low. Route invalidation gets narrower, and the broader per-host query only covers configured proxy IDs for hosts already marked affected by a valid event.
Testing
workflow-testpassed; overall managed run timed out duringworkflow-build-2(62ce3571fc997d5e5b5a93ecb55943e0083dc2d4a9cb6a4b409835a4d1836748).