Open dfawley opened 1 week ago
@apolcyn noticed that if we simply changed the locality ID to use the first address instead of the last, we'd most likely improve the accuracy (since the first address is more likely to be connected to than the last):
Please do not change the locality ID to always use the first address. Reported load needs to be 100% accurate, especially in cases where we're failing over to different backends.
The above comment was suggested as a short-term workaround that would take a few minutes to accomplish while we await the full fix.
Another idea for a short-term fix that will actually get us to 100% correctness but not take as long to implement (hopefully):
balancer.SubConnState
that, when the ConnectivityState
is READY
, contains the connected address.var
s for this field in internal
which the balancer
package assigns to local functions that perform the actions.StateListener
(here) and call updateLocalityID()
based on the connected address's locality.This works better than adding an unexported method to the SubConn
, because the subconn wrapping requires propagating the method everywhere.
This should resolve when dual stack is fully implemented (#6472). Until then, a partial implementation should be possible without requiring much throwaway work.
That should be all we need to correct this issue.