Repository navigation
Conversation
| index = -index - 1; | ||
| final var random = ThreadLocalRandom.current(); | ||
| if (totalWeight == 0.0) { | ||
| return serviceNodes.get(random.nextInt(nodeCount)); |
There was a problem hiding this comment.
We should add log for this. It should ideally never happen
| public class WeightedNodeSelectorConfig { | ||
| @JsonTypeName("weighted") | ||
| @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", requireTypeIdForSubtypes = OptBoolean.FALSE) | ||
| public class WeightedNodeSelectorConfig extends NodeSelectorConfig { |
There was a problem hiding this comment.
Add jsonIgnore properties since you are removing field. Else it will break if someone is setting this field already
|
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.



Description
This MR updates weighted node selection to gradually increase traffic to newly healthy instances and adds a warm-up-aware round-robin selector.
Key Changes
Why This Change?
The previous two-node comparison always preferred the higher-weight node, so gradual weight changes did not produce gradual selection probabilities. Probabilistic selection allows newly healthy instances to receive more traffic as they warm up.
Testing
Compatibility
Consumers must remove weightBoostMultiplier from configuration and builder calls. TimeBasedWeightEnricher now takes only the warm-up duration. Existing default node selection remains unchanged.