Skip to content
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

Fix out of order exemplar error for native histograms #7640

Merged
merged 6 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [BUGFIX] Ingester: Prevent timely compaction of empty blocks. #7624
* [BUGFIX] querier: Don't cache context.Canceled errors for bucket index. #7620
* [BUGFIX] Store-gateway: account for `"other"` time in LabelValues and LabelNames requests. #7622
* [BUGFIX] Ingester: when receiving multiple exemplars for a native histogram in mimir via remote write, only report an error if all are older than the latest exemplar as this could be a partial update. #7640
krajorama marked this conversation as resolved.
Show resolved Hide resolved

### Mixin

Expand Down
10 changes: 10 additions & 0 deletions pkg/ingester/ingester.go
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ func (i *Ingester) pushSamplesToAppender(userID string, timeseries []mimirpb.Pre
})
stats.failedExemplarsCount += len(ts.Exemplars)
} else { // Note that else is explicit, rather than a continue in the above if, in case of additional logic post exemplar processing.
outOfOrderExemplars := 0
for _, ex := range ts.Exemplars {
if ex.TimestampMs > maxTimestampMs {
stats.failedExemplarsCount++
Expand All @@ -1421,6 +1422,15 @@ func (i *Ingester) pushSamplesToAppender(userID string, timeseries []mimirpb.Pre
continue
}

if errors.Is(err, storage.ErrOutOfOrderExemplar) {
outOfOrderExemplars++
// Only report out of order exemplars if all are out of order, otherwise this was a partial update
// to some existing set of exemplars.
if outOfOrderExemplars < len(ts.Exemplars) {
continue
}
}

// Error adding exemplar
updateFirstPartial(nil, func() softError {
return newTSDBIngestExemplarErr(err, model.Time(ex.TimestampMs), ts.Labels, ex.Labels)
Expand Down
Loading
Loading