diff --git a/lib/storage/storage.go b/lib/storage/storage.go index 9b0db5cbc1..30b5dac5a0 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -1073,13 +1073,11 @@ func (s *Storage) add(rows []rawRow, mrs []MetricRow, precisionBits uint8) ([]ra r.TSID = prevTSID continue } - if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) { - if !dmis.Has(r.TSID.MetricID) { - // Fast path - the TSID for the given MetricName has been found in cache and isn't deleted. - prevTSID = r.TSID - prevMetricNameRaw = mr.MetricNameRaw - continue - } + if s.getTSIDFromCache(&r.TSID, mr.MetricNameRaw) && !dmis.Has(r.TSID.MetricID) { + // Fast path - the TSID for the given MetricName has been found in cache and isn't deleted. + prevTSID = r.TSID + prevMetricNameRaw = mr.MetricNameRaw + continue } // Slow path - the TSID is missing in the cache. Search for it in the index.