From 37e5249e33e4c2d7bc49c4ac587faf12eb6785b7 Mon Sep 17 00:00:00 2001 From: zenador Date: Wed, 24 May 2023 19:00:21 +0800 Subject: [PATCH] Use DefaultSamplesPerChunk in tsdb (#12387) Signed-off-by: Jeanette Tan --- tsdb/db.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tsdb/db.go b/tsdb/db.go index a0d0a4b26..12974150b 100644 --- a/tsdb/db.go +++ b/tsdb/db.go @@ -640,6 +640,9 @@ func validateOpts(opts *Options, rngs []int64) (*Options, []int64) { if opts.HeadChunksWriteQueueSize < 0 { opts.HeadChunksWriteQueueSize = chunks.DefaultWriteQueueSize } + if opts.SamplesPerChunk <= 0 { + opts.SamplesPerChunk = DefaultSamplesPerChunk + } if opts.MaxBlockChunkSegmentSize <= 0 { opts.MaxBlockChunkSegmentSize = chunks.DefaultChunkSegmentSize }