diff --git a/pkg/compact/downsample/streamed_block_writer.go b/pkg/compact/downsample/streamed_block_writer.go index c251c5ca15..7ec60ec932 100644 --- a/pkg/compact/downsample/streamed_block_writer.go +++ b/pkg/compact/downsample/streamed_block_writer.go @@ -228,7 +228,7 @@ func (w *StreamedBlockWriter) populateBlock(indexWriter tsdb.IndexWriter) error all := index.NewListPostings(w.postings) for all.Next() { - s := w.series[i] + s := w.series[all.At()] // Skip the series with all deleted chunks. if len(s.chunks) == 0 { level.Info(w.logger).Log("empty chunks", i, s.lset)