Fix panic if series is not found when deleting series

Signed-off-by: Xiaochao Dong (@damnever) <the.xcdong@gmail.com>
This commit is contained in:
Xiaochao Dong (@damnever) 2022-06-23 17:56:31 +08:00
parent 87ffac3e9d
commit 6b042da2d8
1 changed files with 4 additions and 0 deletions

View File

@ -1115,6 +1115,10 @@ func (h *Head) Delete(mint, maxt int64, ms ...*labels.Matcher) error {
var stones []tombstones.Stone
for p.Next() {
series := h.series.getByID(chunks.HeadSeriesRef(p.At()))
if series == nil {
level.Debug(h.logger).Log("msg", "Series not found in Head.Delete")
continue
}
series.RLock()
t0, t1 := series.minTime(), series.maxTime()