Class HelixGroupLatencyAdaptiveStrategy

java.lang.Object
com.linkedin.venice.router.api.routing.helix.HelixGroupLatencyAdaptiveStrategy
All Implemented Interfaces:
HelixGroupSelectionStrategy

public class HelixGroupLatencyAdaptiveStrategy extends Object implements HelixGroupSelectionStrategy
Latency-adaptive Helix group selection strategy: spreads load across groups by a continuous, latency-driven weight instead of the winner-take-all tie-break used by HelixGroupLeastLoadedStrategy. The share/skew math is shared with the fast client in LatencyAdaptiveGroupSelector; this class only adds the router's HelixGroupSelectionStrategy plumbing on top.

HelixGroupLeastLoadedStrategy first picks the group(s) with the fewest in-flight requests, then breaks ties by lowest latency. At low per-router in-flight the counters are almost always tied at ~0, so the tie-break fires on nearly every request and over-concentrates traffic on whichever group is momentarily fastest. This strategy keeps latency as the signal for which group is fast but turns it into a per-group target share and a weighted-random draw, routing evenly while the groups are close and shedding traffic off a group only as its latency pulls ahead. See LatencyAdaptiveGroupSelector for the formula and knobs.

The counter-leak protection via TimeoutProcessor and the synchronized in-flight accounting are preserved from HelixGroupLeastLoadedStrategy; the counters are kept for leak protection and observability (HelixGroupStats.recordGroupPendingRequest(int, int)) and do not influence the target share.