-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
compactor: change GatherIndexIssueStats validation logic on sorted labels #831
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -345,13 +345,12 @@ func GatherIndexIssueStats(logger log.Logger, fn string, minTime int64, maxTime | |
if lastLset != nil && labels.Compare(lastLset, lset) >= 0 { | ||
return stats, errors.Errorf("series %v out of order; previous %v", lset, lastLset) | ||
} | ||
l0 := lset[0] | ||
for _, l := range lset[1:] { | ||
if l.Name <= l0.Name { | ||
return stats, errors.Errorf("out-of-order label set %s for series %d", lset, id) | ||
} | ||
l0 = l | ||
|
||
// Ensure all but the first value (__name__) are sorted | ||
if !sort.SliceIsSorted(lset[1:], func(i, j int) bool { return lset[i+1].Name <= lset[j+1].Name }) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's actually check if name is first maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because I think that's the whole point.. if the labels are ordered name is between uppercase and lowercase already. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a bit different and I might raise a different pull request but what if we would relax this check a bit and switch it to
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moved to #848. |
||
return stats, errors.Errorf("out-of-order label set %s for series %d", lset, id) | ||
} | ||
|
||
if len(chks) == 0 { | ||
return stats, errors.Errorf("empty chunks for series %d", id) | ||
} | ||
|
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.
missing trailing petiof