Repository navigation
Description
Describe the bug
The compactor downloads the parquet files that the parquet converter writes into a block directory. Compaction does not use these files. For each input block of a compaction job, they take local disk space and download time. For a tenant with parquet conversion enabled, each input block takes the TSDB data plus a second copy of the same samples in parquet format. On large tenants this can fill the compactor disk, and compaction of the tenant then stops.
To Reproduce
Steps to reproduce the behavior:
- Start Cortex
v1.22.0-rc.4with blocks storage, the compactor, and the parquet converter enabled (-parquet-converter.enabled=true, with parquet conversion enabled for the tenant). - Write samples to the tenant until the parquet converter has converted some blocks, and these blocks have
<ULID>/<shard>.labels.parquet,<ULID>/<shard>.chunks.parquetand<ULID>/parquet-converter-mark.jsonin the bucket. - Let the compactor plan a compaction that uses these blocks as input.
- Look at the compactor's local work directory (
<data_dir>/compact/<tenant>/<group>/<ULID>/). It holds the*.parquetfiles next toindexandchunks/.
Expected behavior
The compactor downloads only the files that compaction needs (meta.json, index and chunks/). It does not download the parquet converter output.
Additional Context
Code path (tag v1.22.0-rc.4, release-1.22 and master do not change it):
- The parquet converter writes its output under the same object prefix as the TSDB block. See
pkg/parquetconverter/converter.go(convert.WithName(b.ULID.String())),parquet-common/schema/schema.goandpkg/storage/parquet/converter_marker.go. - Before compaction, the compactor downloads each input block with the vendored Thanos
block.Download, which callsobjstore.DownloadDiron the<ULID>/prefix.DownloadDirlists every object under the prefix and goes into subdirectories. It skips onlymeta.jsonand local files whose hash already matchesmeta.Thanos.Files. It has no allowlist of TSDB files and no filter for parquet files. - Compaction reads only
indexandchunks/. The parquet files stay on local disk until the job ends.
Possible fixes:
- Download only the files listed in
meta.Thanos.Files. The converter does not add its files to that list. - Or give
block.Downloadan ignore filter, and make the compactor pass*.parquetandparquet-converter-mark.json.
Activity
souvik-biswas-dev commentedon Nov 25, 2026
I'd like to take this. Reproduced the analysis: the compactor's block download pulls
*.parquetandparquet-converter-mark.json. Plan: filter them in the compactor's download step (using an ignore option if the vendored objstore supports one, otherwise limiting the download to files inmeta.Thanos.Files), with a test that parquet files aren't downloaded. @friedrichg, any preference between the two approaches?Compactor: skip parquet converter files when downloading blocks
souvik-biswas-dev commentedon Nov 26, 2026
Opened #7972. While implementing, I found that neither approach can be done from Cortex alone: block.Download is vendored Thanos code that builds its own ignore list and overwrites any ignore option the caller passes, and the compaction code calling it is vendored too. The PR instead filters at the bucket level: the compactor's per-tenant bucket hides *.parquet and parquet-converter-mark.json from Iter, so block.Download never lists them, while the blocks cleaner still uses the unwrapped bucket. Happy to move this upstream into Thanos instead if you prefer.
Compactor: skip parquet converter files when downloading blocks
Compactor: skip parquet converter files when downloading blocks (cort…