Skip to content

GRPCLB should keep drop index when new picker is created due to subchannel state change #5337

Open
@zhangkun83

Description

@zhangkun83

Currently in GrpclbState, subchannel state change produces a new RoundRobinPicker, which has dropIndex initially 0. This may cause the client to drop more or less percentage of requests than the percentage of drop entries in the list.

To fix the problem, the dropIndex of the previous picker should be passed to the new picker, if the new picker is due to subchannel state change. dropIndex should be a mutable integer (maybe AtomicInteger) shared by the previous and new pickers, so that the new picker doesn't take a premature snapshot of it.

In the case where the balancer sends a new drop list, dropIndex will keep starting from 0.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions