Fix bounded consistent hash with filtered endpoints#4138
Open
shrikant23codes wants to merge 1 commit into
Open
Fix bounded consistent hash with filtered endpoints#4138shrikant23codes wants to merge 1 commit into
shrikant23codes wants to merge 1 commit into
Conversation
Signed-off-by: shrikant23codes <jiturishrikant@gmail.com>
MustafaSaber
approved these changes
Jul 17, 2026
MustafaSaber
left a comment
Contributor
There was a problem hiding this comment.
Thanks, nice catch!
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.
Fix
boundedLoadSearchso it advances to the next hash ring entry when the current endpoint has been filtered out. Filtered endpoints can happen before load balancing, for example through fade-in.In bounded-load mode, the algorithm starts from the normal consistent-hash target. If that endpoint is overloaded, it walks forward in the hash ring looking for another endpoint below the load threshold.
Before this change, if the walk reached a filtered endpoint, the loop continued without advancing the ring index. This could repeatedly check the same filtered endpoint and eventually return it.
Example case:
Tests
Suggested label: bug
Fixes: #4139