-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Snap to non-fractioned scaling boundaries #60
Conversation
Signed-off-by: Oliver Trosien <[email protected]>
Signed-off-by: Oliver Trosien <[email protected]>
Signed-off-by: Oliver Trosien <[email protected]>
Signed-off-by: Oliver Trosien <[email protected]>
👍 |
operator/autoscaler.go
Outdated
@@ -293,7 +293,9 @@ func (as *AutoScaler) scaleUpOrDown(esIndices map[string]ESIndex, scalingHint Sc | |||
} | |||
} | |||
|
|||
newDesiredNodeReplicas := as.ensureUpperBoundNodeReplicas(scalingSpec, int32(math.Ceil(float64(currentTotalShards)/float64(currentShardToNodeRatio-1)))) | |||
// round down to the next non-fractioned shard-to-node ratio | |||
newShardToNodeRatio := math.Ceil(float64(currentTotalShards) / math.Floor(currentShardToNodeRatio-0.00001)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little hacky, what is the reason for this particular fraction? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just getting the code to round down. Too much magic? Shall I extract this into a private method and add more tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added more tests... WDYT?
Signed-off-by: Oliver Trosien <[email protected]>
bdb22a9
to
91ed120
Compare
Signed-off-by: Oliver Trosien <[email protected]>
👍 |
adressed some of the review comments. |
👍 |
Fixes #59