diff --git a/lib/storage/storage.go b/lib/storage/storage.go index f8afceb6c1..738d31c6f4 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -740,6 +740,9 @@ func (s *Storage) mustRotateIndexDB() { } func (s *Storage) resetAndSaveTSIDCache() { + // Reset cache and then store the reset cache on disk in order to prevent + // from inconsistent behaviour after possible unclean shutdown. + // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1347 s.tsidCache.Reset() s.mustSaveCache(s.tsidCache, "MetricName->TSID", "metricName_tsid") }