Skip to content

Compactor downloads parquet converter files that compaction does not use #7967

Done

Description

@friedrichg

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:

  1. Start Cortex v1.22.0-rc.4 with blocks storage, the compactor, and the parquet converter enabled (-parquet-converter.enabled=true, with parquet conversion enabled for the tenant).
  2. Write samples to the tenant until the parquet converter has converted some blocks, and these blocks have <ULID>/<shard>.labels.parquet, <ULID>/<shard>.chunks.parquet and <ULID>/parquet-converter-mark.json in the bucket.
  3. Let the compactor plan a compaction that uses these blocks as input.
  4. Look at the compactor's local work directory (<data_dir>/compact/<tenant>/<group>/<ULID>/). It holds the *.parquet files next to index and chunks/.

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):

  1. 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.go and pkg/storage/parquet/converter_marker.go.
  2. Before compaction, the compactor downloads each input block with the vendored Thanos block.Download, which calls objstore.DownloadDir on the <ULID>/ prefix. DownloadDir lists every object under the prefix and goes into subdirectories. It skips only meta.json and local files whose hash already matches meta.Thanos.Files. It has no allowlist of TSDB files and no filter for parquet files.
  3. Compaction reads only index and chunks/. 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.Download an ignore filter, and make the compactor pass *.parquet and parquet-converter-mark.json.

Activity

  1. souvik-biswas-dev commented on Nov 25, 2026

    @souvik-biswas-dev
    Contributor

    I'd like to take this. Reproduced the analysis: the compactor's block download pulls *.parquet and parquet-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 in meta.Thanos.Files), with a test that parquet files aren't downloaded. @friedrichg, any preference between the two approaches?

  2. added a commit that references this issue on Nov 26, 2026
    36b3772
  3. souvik-biswas-dev commented on Nov 26, 2026

    @souvik-biswas-dev
    Contributor

    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.

  4. added a commit that references this issue on Nov 30, 2026
    69da018
  5. added a commit that references this issue on Nov 30, 2026
    7da992e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions