-
Notifications
You must be signed in to change notification settings - Fork 816
Allow shard sizes to be percent of instances #5393
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
Conversation
85a2161
to
1189bab
Compare
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 like that we are not adding another flag.
The operator in me says this flag needs a percentage sign like kubernetes does it. For humans to understand it better.
The developer in me says this number comes another system, this should be machine readable 😄
I can see value in both.
pkg/util/shard.go
Outdated
@@ -43,3 +43,12 @@ func ShuffleShardExpectedInstancesPerZone(shardSize, numZones int) int { | |||
func ShuffleShardExpectedInstances(shardSize, numZones int) int { | |||
return ShuffleShardExpectedInstancesPerZone(shardSize, numZones) * numZones | |||
} | |||
|
|||
// DynamicShardSize returns the shard size as a percentage of numInstances if the value is < 1. If the value is > 1, the value is rounded and returned. |
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.
// DynamicShardSize returns the shard size as a percentage of numInstances if the value is < 1. If the value is > 1, the value is rounded and returned. | |
// DynamicShardSize returns the shard size as a percentage of numInstances if the value is < 1. If the value is >= 1, the value is rounded and returned. |
Signed-off-by: 🌲 Harry 🌊 John 🏔 <[email protected]>
1189bab
to
df3dc25
Compare
I agree. :) |
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.
Thanks. LGTM
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.
Thanks! Nice implementation and great work
What this PR does:
This PR allows querier and store-gateway tenant shard sizes to be configured as a percentage of a total
For backwards compatibility, the data type was changed to float64.
Which issue(s) this PR fixes:
Fixes #5374
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]