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 b71be42d90
commit 6ff71474a6
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -725,6 +725,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")
}