Skip to content

util: Enforce the maximum outlier ejection percentage - #13178

Open
goutamadwant wants to merge 1 commit into
grpc:masterfrom
goutamadwant:fix-outlier-ejection-limit
Open

goutamadwant wants to merge 1 commit into
grpc:masterfrom
goutamadwant:fix-outlier-ejection-limit

Conversation

@goutamadwant

Copy link
Copy Markdown

Check whether ejecting one more endpoint would exceed maxEjectionPercent in both the success-rate and failure-percentage algorithms. For example, a 30% limit with five endpoints now permits one ejection instead of two, matching the updated A50 contract.

Use integer cross-multiplication to preserve exact percentage boundaries without floating-point rounding. Add regression coverage for fractional and exact limits, zero, limits below one endpoint, existing ejections, both algorithms enabled, and a single endpoint at 100%.

Fixes #13164

Validation:

  • Reproduced 10 failing regression cases against the original implementation.
  • All 196 grpc-util tests passed, including 90 OutlierDetectionLoadBalancerTest cases; Checkstyle and Animal Sniffer checks passed.
  • All 22 CdsLoadBalancer2Test cases passed.

Commands:

./gradlew :grpc-util:test --tests 'io.grpc.util.OutlierDetectionLoadBalancerTest' -PskipCodegen=true -PskipAndroid=true
./gradlew :grpc-util:check :grpc-xds:test --tests 'io.grpc.xds.CdsLoadBalancer2Test' -PskipCodegen=true -PskipAndroid=true

The full repository build and hosted CI have not been run.

Check the prospective ejected endpoint count before either outlier
detection algorithm ejects another endpoint. Use integer arithmetic to
respect exact percentage boundaries, and cover both algorithms and
existing ejections with regression tests.

Fixes grpc#13164

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outlier detection can eject one too many endpoints

1 participant