Skip to content

pkg/distributor: shardByAllLabels didn't check for label names order correctly #1957

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

Merged
merged 2 commits into from
Jan 7, 2020
Merged

pkg/distributor: shardByAllLabels didn't check for label names order correctly #1957

merged 2 commits into from
Jan 7, 2020

Conversation

pstibrany
Copy link
Contributor

shardByAllLabels had a check to verify if labels are sorted properly, but it didn't set lastLabelName, so it was comparing label names against empty string only.

…correctly

shardByAllLabels had a check to verify if labels are sorted properly, but it
didn't set lastLabelName, so it was comparing label names against empty string
only.

Signed-off-by: Peter Štibraný <[email protected]>
Signed-off-by: Peter Štibraný <[email protected]>
@gouthamve
Copy link
Contributor

This change affects only if shardByAllLabels is used right? If yes then LGTM

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good that you spotted it! LGTM.

Note to myself: the fix doesn't cause are-sharding (the token in the tests is different because the input fixture is different).

@pstibrany
Copy link
Contributor Author

pstibrany commented Jan 7, 2020

This change affects only if shardByAllLabels is used right? If yes then LGTM

Yes.

Recently I've seen someone pointing out that we are not consistent about this check at various code paths. If only I remembered where it was. I believe that we should disallow unsorted labels everywhere consistently.

Copy link
Contributor

@jtlisi jtlisi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gouthamve gouthamve merged commit f49eb9e into cortexproject:master Jan 7, 2020
gouthamve added a commit that referenced this pull request Jan 7, 2020
gouthamve added a commit that referenced this pull request Jan 9, 2020
…s order correctly (#1957)"

This reverts commit f49eb9e.

Signed-off-by: Goutham Veeramachaneni <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants