-
Notifications
You must be signed in to change notification settings - Fork 797
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
Deprecate -distributor.shard-by-all-labels #6022
base: master
Are you sure you want to change the base?
Deprecate -distributor.shard-by-all-labels #6022
Conversation
7d1e9b6
to
f4693b7
Compare
@friedrichg is there any additional step required to fix this? https://github.com/cortexproject/cortex/actions/runs/9547290567/job/26311997676?pr=6022#step:9:12 |
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.
Thank you! only nits now
@tesla59 the lint needs to pass too |
Signed-off-by: tesla59 <[email protected]>
f4693b7
to
b05e549
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.
Sorry, I did another pass and these are still related and should be removed:
grep -R ShardByAllLabels *
pkg/cortex/cortex.go: if err := c.LimitsConfig.Validate(c.Distributor.ShardByAllLabels); err != nil {
pkg/cortex/modules.go: t.Cfg.Ingester.DistributorShardByAllLabels = t.Cfg.Distributor.ShardByAllLabels
pkg/ingester/ingester.go: DistributorShardByAllLabels bool `yaml:"-"`
pkg/ingester/ingester.go: cfg.DistributorShardByAllLabels,
pkg/ingester/ingester.go: cfg.DistributorShardByAllLabels,
pkg/distributor/query.go: if !d.cfg.ShardByAllLabels && len(matchers) > 0 {
pkg/distributor/distributor.go: ShardByAllLabels bool `yaml:"shard_by_all_labels"`
pkg/distributor/distributor.go: cfg.ShardByAllLabels = true
pkg/distributor/distributor.go: if d.cfg.ShardByAllLabels {
pkg/distributor/distributor.go: if d.cfg.ShardByAllLabels {
pkg/distributor/distributor_test.go: distributorCfg.ShardByAllLabels = true
pkg/distributor/distributor_test.go: distributorCfg.ShardByAllLabels = cfg.shardByAllLabels
pkg/distributor/distributor_test.go:func TestShardByAllLabelsReturnsWrongResultsForUnsortedLabels(t *testing.T) {
just assume the value is true and organize the code accordingly
@friedrichg should i remove the field from the config struct itself? cortex/pkg/distributor/distributor.go Line 141 in 057313a
|
Signed-off-by: tesla59 <[email protected]>
If this is removed, wouldn't this cause problems for config files that still reference this field? |
Can we assume that the value is true and remove wherever its referenced? |
Signed-off-by: tesla59 <[email protected]>
Signed-off-by: tesla59 <[email protected]>
I think the flag and field in the config struct should still exist, but marked as deprecated until it's fully removed. Perhaps the default should be set to true, and if someone is still setting it to false, then an error or warning should appear letting them know that the behavior is changing. If we completely remove the field, people that are upgrading to this version will see an error like:
More info about the unmarshalling: Lines 245 to 248 in 498635f
|
the test should compile @tesla59. A review is not worth for code that doesn't compile, I feel. |
Hey @friedrichg Also I'm not sure about how u got notification for review. I didn't ping u because I was still working on fixing the build |
@tesla59 Just trying to guide the PR on the next step to follow. Thanks for your work so far! |
We are in the process of releasing 1.18 |
What this PR does:
Remove the flag
distributor.shard-by-all-labels
and sets it to true by defaultWhich issue(s) this PR fixes:
Fixes #6021
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]