-
Notifications
You must be signed in to change notification settings - Fork 9k
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
"Label names with matchers" call returns "not found" during compaction #14278
Comments
colega
added a commit
to colega/prometheus
that referenced
this issue
Jun 7, 2024
It's quite common during the compaction cycle to hold series IDs for series that aren't in the TSDB head anymore. We shouldn't fail if that happens, as the caller has no way to figure out which one of the IDs doesn't exist. Fixes prometheus#14278 Signed-off-by: Oleg Zaytsev <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do?
I called the "label names with matchers" during TSDB compaction.
What did you expect to see?
A successful response.
What did you see instead? Under which circumstances?
A "not found" error.
When it calls the
headIndexReader.LabelNames(...)
:prometheus/tsdb/head_read.go
Lines 90 to 104 in edd5588
That calls the
labelNamesWithMatcher(...)
:prometheus/tsdb/querier.go
Lines 445 to 460 in edd5588
Imagine that a compaction happens between
p, err := PostingsForMatchers(ctx, r, matchers...)
andreturn r.LabelNamesFor(ctx, postings...)
calls in that method, thenpostings...
contains references to series that were garbage-collected.However,
headIndexReader.LabelNamesFor
fails in that case:prometheus/tsdb/head_read.go
Lines 278 to 281 in edd5588
This error breaks the loop and is not handled.
IMO, it shouldn't break the loop, this is a common case during compaction.
System information
No response
Prometheus version
No response
Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response
The text was updated successfully, but these errors were encountered: