diff --git a/pkg/ingester/ingester.go b/pkg/ingester/ingester.go index 2502ef8c76..bf921243af 100644 --- a/pkg/ingester/ingester.go +++ b/pkg/ingester/ingester.go @@ -2808,6 +2808,9 @@ func (i *Ingester) expirePostingsCache(ctx context.Context) error { return nil } userDB := i.getTSDB(userID) + if userDB == nil || userDB.postingCache == nil { + continue + } userDB.postingCache.PurgeExpiredItems() }