Skip to content

Commit

Permalink
estimate block chunk and series size from metadata (#6449)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <benye@amazon.com>
  • Loading branch information
yeya24 committed Jun 16, 2023
1 parent 4bc0b8e commit d430269
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cmd/thanos/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,18 @@ func runStore(
store.WithFilterConfig(conf.filterConf),
store.WithChunkHashCalculation(true),
store.WithSeriesBatchSize(conf.seriesBatchSize),
store.WithBlockEstimatedMaxSeriesFunc(func(_ metadata.Meta) uint64 {
store.WithBlockEstimatedMaxSeriesFunc(func(m metadata.Meta) uint64 {
if m.Thanos.IndexStats.SeriesMaxSize > 0 &&
uint64(m.Thanos.IndexStats.SeriesMaxSize) < conf.estimatedMaxSeriesSize {
return uint64(m.Thanos.IndexStats.SeriesMaxSize)
}
return conf.estimatedMaxSeriesSize
}),
store.WithBlockEstimatedMaxChunkFunc(func(_ metadata.Meta) uint64 {
store.WithBlockEstimatedMaxChunkFunc(func(m metadata.Meta) uint64 {
if m.Thanos.IndexStats.ChunkMaxSize > 0 &&
uint64(m.Thanos.IndexStats.ChunkMaxSize) < conf.estimatedMaxChunkSize {
return uint64(m.Thanos.IndexStats.ChunkMaxSize)
}
return conf.estimatedMaxChunkSize
}),
}
Expand Down

0 comments on commit d430269

Please sign in to comment.