_ClientRoutesHandler.handle_client_routes_change() can remove valid cached proxy routes when a CLIENT_ROUTES_CHANGE event mixes configured and unrelated connection_id values.
Problem
The handler converts all event host_ids to host_uuids, then filters (connection_id, host_id) pairs down to configured connection_ids before querying system.client_routes.
However, it currently calls _RouteStore.merge(..., affected_host_ids=set(host_uuids)), so merge() treats every host in the original event as affected, including hosts whose event entry belonged only to an unrelated connection_id.
Because merge() removes existing routes for every affected host before adding queried rows, a mixed event can delete an existing valid route for a host that was not actually updated for this driver configuration.
A related route-state issue exists in ClientRoutesEndPoint: endpoint equality and hashing ignore original_port, so two endpoints for the same host_id and original address but different ports collapse to the same metadata key.
Expected behavior
- Partial route merges should only mark hosts from configured
(connection_id, host_id) event pairs as affected.
ClientRoutesEndPoint identity should include original_port.
Notes
This is distinct from #813: that issue is about preserving same-host connection-id stickiness when partial events omit the currently selected route. This issue is about deleting routes for hosts whose event entries were filtered out as unrelated.
_ClientRoutesHandler.handle_client_routes_change()can remove valid cached proxy routes when aCLIENT_ROUTES_CHANGEevent mixes configured and unrelatedconnection_idvalues.Problem
The handler converts all event
host_idstohost_uuids, then filters(connection_id, host_id)pairs down to configuredconnection_ids before queryingsystem.client_routes.However, it currently calls
_RouteStore.merge(..., affected_host_ids=set(host_uuids)), somerge()treats every host in the original event as affected, including hosts whose event entry belonged only to an unrelatedconnection_id.Because
merge()removes existing routes for every affected host before adding queried rows, a mixed event can delete an existing valid route for a host that was not actually updated for this driver configuration.A related route-state issue exists in
ClientRoutesEndPoint: endpoint equality and hashing ignoreoriginal_port, so two endpoints for the samehost_idand original address but different ports collapse to the same metadata key.Expected behavior
(connection_id, host_id)event pairs as affected.ClientRoutesEndPointidentity should includeoriginal_port.Notes
This is distinct from #813: that issue is about preserving same-host connection-id stickiness when partial events omit the currently selected route. This issue is about deleting routes for hosts whose event entries were filtered out as unrelated.