From c498b091e248590c1cf009fea8d235f24f61eda1 Mon Sep 17 00:00:00 2001 From: James Guthrie Date: Mon, 3 Oct 2022 11:32:29 +0200 Subject: [PATCH] Add logging for cache reset --- pkg/pgmodel/ingestor/dispatcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/pgmodel/ingestor/dispatcher.go b/pkg/pgmodel/ingestor/dispatcher.go index 9784cbd54c..601497ce46 100644 --- a/pkg/pgmodel/ingestor/dispatcher.go +++ b/pkg/pgmodel/ingestor/dispatcher.go @@ -154,7 +154,9 @@ func (p *pgxDispatcher) runSeriesEpochSync() { func (p *pgxDispatcher) refreshSeriesEpoch(existingEpoch *model.SeriesEpoch) (*model.SeriesEpoch, error) { dbEpoch, err := p.getServerEpoch() + log.Info("msg", "Refreshing series cache epoch") if err != nil { + log.Info("msg", "An error occurred refreshing, will reset series and inverted labels caches") // Trash the cache just in case an epoch change occurred, seems safer p.scache.Reset() // Also trash the inverted labels cache, which can also be invalidated when the series cache is @@ -162,6 +164,7 @@ func (p *pgxDispatcher) refreshSeriesEpoch(existingEpoch *model.SeriesEpoch) (*m return nil, err } if existingEpoch == nil || *dbEpoch != *existingEpoch { + log.Info("msg", "The local epoch is no longer up-to-date, will reset series and inverted labels caches") p.scache.Reset() // If the series cache needs to be invalidated, so does the inverted labels cache p.invertedLabelsCache.Reset()