From 7852a7c5162a7ebd21a8766e3a75d7de1ac1cf3c Mon Sep 17 00:00:00 2001 From: Marco Pracucci Date: Tue, 16 Jan 2024 12:00:53 +0100 Subject: [PATCH] Fix regressions introduced by #13242 Signed-off-by: Marco Pracucci --- tsdb/compact.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tsdb/compact.go b/tsdb/compact.go index 511c518d9..efe3306c7 100644 --- a/tsdb/compact.go +++ b/tsdb/compact.go @@ -188,12 +188,12 @@ func NewLeveledCompactorWithOptions(ctx context.Context, r prometheus.Registerer if mergeFunc == nil { mergeFunc = storage.NewCompactingChunkSeriesMerger(storage.ChainedSeriesMerge) } - var maxBlockChunkSegmentSize int64 - if opts.MaxBlockChunkSegmentSize == 0 { + maxBlockChunkSegmentSize := opts.MaxBlockChunkSegmentSize + if maxBlockChunkSegmentSize == 0 { maxBlockChunkSegmentSize = chunks.DefaultChunkSegmentSize } - var pe index.PostingsEncoder - if opts.PE == nil { + pe := opts.PE + if pe == nil { pe = index.EncodePostingsRaw } return &LeveledCompactor{