Repository navigation
[Nexthop][bugfix] Assert ECMP balance as share of fair share in prune tests - #1744
Open
raghavv-nexthop wants to merge 2 commits into
Open
raghavv-nexthop wants to merge 2 commits into
raghavv-nexthop wants to merge 2 commits into
Conversation
Signed-off-by: raghavv-nexthop <raghavv@nexthop.ai>
raghavv-nexthop
marked this pull request as ready for review
October 14, 2026 00:51
Contributor
Author
|
/autorebase |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-submission checklist
pip install -r requirements-dev.txt && pre-commit installpre-commit runSummary
Based on #1595.
Issue:
AgentAdjFrrRouteTestsandAgentFlowletSwitchingTestsassert load balance as a min/max spread,(highest - lowest) / lowest. The cap is 25% (kMaxLoadBalanceDeviationPct), raised to 125% (kPrunedLoadBalanceDeviationPct) when the ingress port is a group member and gets pruned.hashSpreadBoundPct()also applies 125% to any group whose width is not a multiple of four.Pruning concentrates traffic on purpose, so no single spread cap works for both pruned and unpruned phases. Same test, same boot, one phase apart:
The group is healthy (1.6% spread unpruned). Pruning moves the pruned member's share onto one survivor, which pushes the spread past even the relaxed 125% cap. This is deterministic to within about 1% across cold and warm boot, so it is expected behavior, not a regression.
The
width % 4relaxation keys off the wrong variable. A width-6 group is even when unpruned (lowest 2592, highest 2920, i.e. 95–107% of fair share) and skews only when pruned (highest 5600). The same 125% cap also lets a width-6 group pass with one member at 50% of fair share. As a result,sourcePortGetsPruned,sourcePortPruneWithEmptyPrimary,frrPruneFiveBackupsNoLoss,frrPruneSixBackupsNoLossandVerifyDlbSecondaryPruneSixMembersNoLossfail intermittently or consistently on Tomahawk5.Fix:
Apply the participation check from #1595 to these suites. Each member must carry between a floor and a ceiling percentage of the fair share (
total / numMembers):[80, 125]. Any group within a 25% spread already lies inside this band, so it is at least as strict as the old cap, and stricter than the old% 4relaxation.[25, 200](theMemberShareBoundsdefault). Measured pruned skew is 51–171% of fair share.Changes:
LoadBalancerTestUtils.{h,cpp}: addisWithinMemberShareBounds(), for callers that hold one counter per member rather than aPortStatsmap. It reusesMemberShareBounds.AgentAdjFrrRouteTests.cpp,AgentFlowletSwitchingTests.cpp: replace the spread constants with share bounds, and removehashSpreadBoundPct()and its call sites.Notes:
AgentAdjFrrRouteTestsremain unasserted, as before.Test Plan
Ran on Wedge800BACT with source-port pruning enabled: