lib/storage: document why tsid cache is reset before saving it to disk

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2205
This commit is contained in:
Aliaksandr Valialkin 2022-02-16 18:37:26 +02:00
parent ee066aa0d5
commit 63bc89dd81
No known key found for this signature in database
GPG Key ID: A72BEC6CD3D0DED1

View File

@ -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")
}