Repository navigation
Compactor: skip parquet converter files when downloading blocks - #7972
SungJin1212 merged 3 commits into
Conversation
e6019c0 to
36b3772
Compare
| if strings.HasSuffix(name, objstore.DirDelim) { | ||
| return false | ||
| } | ||
| return strings.HasSuffix(name, parquetFileSuffix) || path.Base(name) == cortex_parquet.ConverterMarkerFileName |
There was a problem hiding this comment.
The converter also writes parquet-no-convert-mark.json under the block prefix when it skips a block with too many label names.
How about filtering it as well? It's tiny, but for consistency.
|
Would you mind adding a compactor-level test? |
|
Thanks for the review, both points are addressed in the latest commit. The filter now also hides |
| var parquetTestFiles = []string{ | ||
| "0.labels.parquet", | ||
| "0.chunks.parquet", | ||
| "1.labels.parquet", | ||
| "nested/2.chunks.parquet", | ||
| cortex_parquet.ConverterMarkerFileName, | ||
| cortex_parquet.NoConvertMarkerFileName, | ||
| } |
There was a problem hiding this comment.
LGTM, just one nit.
Could you declare the file list inline in each test instead?
|
Thanks! Done: each test now declares its parquet file list inline, and the shared variable is gone (the upload helper takes the list as an argument). |
|
Friendly ping: the nit from the last review is addressed. Could a maintainer approve the workflow run for the latest commit and take another look when you have time? Thanks! |
|
@friedrichg |
The parquet converter writes its output under the same object prefix as the TSDB block, along with parquet-converter-mark.json. block.Download lists and downloads everything under that prefix and has no allowlist or filter for these files, so the compactor pulled *.parquet files and the marker onto local disk even though compaction only reads the index and chunks. block.Download is vendored Thanos code and builds its own ignore list, so the filter cannot be passed in from here. Wrap the per-tenant bucket used for compaction so that parquet files and the converter marker are hidden from Iter and IterWithAttributes. Reads, uploads and deletes are unchanged, and the blocks cleaner keeps using the unwrapped bucket, so it still sees and deletes these files with the block. Fixes cortexproject#7967 Signed-off-by: Souvik Biswas <[email protected]>
…test The parquet converter also writes parquet-no-convert-mark.json under the block prefix when it skips a block with too many label names. Hide it from listings together with the other parquet converter files. Add a compactor-level test: two real TSDB blocks plus parquet files and both markers in an in-memory bucket, run a compaction cycle, and assert that the index and chunks were read while no parquet file or marker was. Signed-off-by: Souvik Biswas <[email protected]>
Signed-off-by: Souvik Biswas <[email protected]>
|
Rebased onto the latest master and resolved the CHANGELOG conflict; no code changes. |
be0d23f to
9be3f71
Compare
|
@souvik-biswas-dev |
What this PR does:
The parquet converter writes
*.parquetfiles andparquet-converter-mark.jsonunder the same object prefix as the TSDB block.block.Downloadlists everything under that prefix and downloads it, with no allowlist or filter, so the compactor pulled these files onto local disk even though compaction only readsindexandchunks/.block.Downloadis vendored Thanos code. It builds its own ignore list (meta.jsonplus files whose hash already matches) and overwrites anyWithDownloadIgnoredPathsoption passed by the caller, so neither option from the issue can be implemented from Cortex alone.This PR instead wraps the per-tenant bucket used for compaction in
compactUser, so parquet files and the converter marker are hidden fromIterandIterWithAttributes. Reads, uploads and deletes are unchanged. The blocks cleaner and the other components keep using the unwrapped bucket, so they still see these files and delete them together with the block. The compaction path only callsMarkForDeletion, which never lists the block.Tests cover the filtered listings, reads staying unfiltered, the filter surviving
WithExpectedErrs, andblock.Downloadskipping the parquet files (with an unfiltered control download that does fetch them).Which issue(s) this PR fixes:
Fixes #7967
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]docs/configuration/v1-guarantees.mdupdated if this PR introduces experimental flags