Skip to content

The compactor screens candidates by the catalog's own file sizes, so a file at or above the threshold is never opened (T-463) - #330

Merged
chasers merged 2 commits into
t-464-catalog-try-layerfrom
t-463-size-from-catalog
Sep 11, 2026
Merged

The compactor screens candidates by the catalog's own file sizes, so a file at or above the threshold is never opened (T-463)#330
chasers merged 2 commits into
t-464-catalog-try-layerfrom
t-463-size-from-catalog

Conversation

@chasers

@chasers chasers commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Tracker: T-463. Stacked on #329 (T-464).

The compactor read every owned segment's Parquet footer on every sweep to find the undersized ones. Once the engines stopped caching file reads (T-461) that was two store requests per file per sweep on tables with nothing to compact — tens of thousands of GETs per sweep on a 10k-file S3 table, and a sweep spending its interval sizing (raised by the review of #325/#326).

A table is now listed through Catalog.segment_files/3, which carries the whole-file size DuckLake recorded at registration, and a file at or above compact_below_bytes by that measure is never a candidate. Its compressed-data sum is smaller still, so the screen only tightens the threshold by a footer's width. A size the catalog does not know keeps the file a candidate. Footers are still read for the candidates, since sizing is where a corrupt file first fails and the quarantine keys on that.

Test: with every file above the threshold, a corrupted one costs nothing and the sweep reports no failure. Deployment note added.

🤖 Generated with Claude Code

https://claude.ai/code/session_014K63Kxq4pf7eD9K1416Eju

Chase Granberry and others added 2 commits September 11, 2026 21:15
…a file at or above the threshold is never opened (T-463)

Every sweep read every owned segment's footer to find the undersized ones,
and once the engines stopped caching file reads (T-461) a table with
nothing to compact cost two store requests per file per sweep, forever —
tens of thousands of GETs per sweep on a 10k-file S3 table, and a sweep
that spent its interval sizing.

A table is now listed through Catalog.segment_files/3, which carries the
whole-file size DuckLake recorded at registration, and a file at or above
compact_below_bytes by that measure is never a candidate: its
compressed-data sum is smaller still, so the screen only tightens the
threshold by a footer's width. A size the catalog does not know keeps the
file a candidate. Footers are still read for the candidates, since sizing
is where a corrupt file first fails and the quarantine keys on that.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014K63Kxq4pf7eD9K1416Eju
…he files it was handed

The compactor fetched the current snapshot and then the file list, two
statements on the serialized compaction connection where one had been,
and the same pair was copied in the merge. Catalog.segment_files/3 now
accepts :current and DuckLake resolves the snapshot in one place; the
compactor and the merge ask for :current. The screen re-joined sizes onto
paths it had stripped one line earlier through a map with a default and a
sentinel clause that could not fire; it filters the listed files by the
plannable paths instead, and the docs name plan/2 and segment_files/3
again.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014K63Kxq4pf7eD9K1416Eju
@chasers
chasers force-pushed the t-463-size-from-catalog branch from d4bdcc9 to c45ce19 Compare September 11, 2026 21:15
@chasers
chasers merged commit 002dbe9 into main Sep 11, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant