From 6b042da2d8f9a7267dbe76e59b830cf248c063e2 Mon Sep 17 00:00:00 2001 From: "Xiaochao Dong (@damnever)" Date: Thu, 23 Jun 2022 17:56:31 +0800 Subject: [PATCH] Fix panic if series is not found when deleting series Signed-off-by: Xiaochao Dong (@damnever) --- tsdb/head.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tsdb/head.go b/tsdb/head.go index fc09d232f..669b7eaaa 100644 --- a/tsdb/head.go +++ b/tsdb/head.go @@ -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()