You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When RoundRobinPolicy is used as a child policy, calling its plan method
twice will cause the round robin's index to increase by 2. This could
led to some nodes not receiving any requests.
Let's consider the following scenario:
- Round robin's index is even
- User sends a query with a token equal to X
- TokenAwarePolicy computes a set of replicas for this query - {A, B}
- TokenAwarePolicy runs a RoundRobin child policy on that set and gets
{A, B}. Round robin's index is odd
- TokenAwarePolicy runs a RoundRobin child policy to generate fallback.
Round robin's index is even
Because the list of steps starts and ends with the same parity of the
round robin index, the beginning of load balancing plan will be the same
for every query with token equal to X.
Hashing round robin index before rotating is a mitigation to this
problem (@piodul's suggestion).
0 commit comments