mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 13:44:05 -08:00
headIndexReader.LabelNamesFor: skip not found series
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 https://github.com/prometheus/prometheus/issues/14278 Signed-off-by: Oleg Zaytsev <mail@olegzaytsev.com>
This commit is contained in:
parent
edd558884b
commit
d0d361da53
|
@ -277,7 +277,9 @@ func (h *headIndexReader) LabelNamesFor(ctx context.Context, ids ...storage.Seri
|
||||||
}
|
}
|
||||||
memSeries := h.head.series.getByID(chunks.HeadSeriesRef(id))
|
memSeries := h.head.series.getByID(chunks.HeadSeriesRef(id))
|
||||||
if memSeries == nil {
|
if memSeries == nil {
|
||||||
return nil, storage.ErrNotFound
|
// Series not found, this happens during compaction,
|
||||||
|
// when series was garbage collected after the caller got the series IDs.
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
memSeries.lset.Range(func(lbl labels.Label) {
|
memSeries.lset.Range(func(lbl labels.Label) {
|
||||||
namesMap[lbl.Name] = struct{}{}
|
namesMap[lbl.Name] = struct{}{}
|
||||||
|
|
Loading…
Reference in a new issue