diff --git a/tsdb/postings_for_matchers_cache.go b/tsdb/postings_for_matchers_cache.go index 6ac0fc20fb..64c7cd0f6a 100644 --- a/tsdb/postings_for_matchers_cache.go +++ b/tsdb/postings_for_matchers_cache.go @@ -112,7 +112,7 @@ func (c *PostingsForMatchersCache) postingsForMatchersPromise(ctx context.Contex // Estimate the size of the cache entry, in bytes. We use max() because // size.Of() returns -1 if the value is nil. - estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(wg))) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner))) + estimatedSizeBytes := int64(len(key)) + max(0, int64(size.Of(outerErr))) + max(0, int64(size.Of(cloner))) c.created(key, c.timeNow(), estimatedSizeBytes) return promise