Repository navigation
test(cleanup): pass an explicit region to the foreign root fixture - #11095
Merged
Merged
Conversation
The managed-blob write reloads the existing child dataset through base 7, so the external base resolver eagerly constructs a store for that S3 base. Without a region in the write params it discovered one with a live S3 HEAD, which timed out on the CI runner and failed the test before its cleanup assertions ran. Pin the fixture's existing test region and credentials in the write params, and reuse the same options for the later reload.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
BubbleCal
approved these changes
Nov 15, 2026
Xuanwo
added a commit
that referenced
this pull request
Nov 15, 2026
`FileFragment::storage_stats` only opened the fragment's base data files, so the bytes a field's values occupy in data overlay files were left out of bytes_on_disk. Open each overlay's data file as well and add its column sizes to the fields it holds. ### Integration verification Integrated with main `580690261d180090bb06b010f5d11600fe09b66a`, which carries the #11095 cleanup fixture repair; merge commit `6fa22cbb9a4bcc91f2ee74d2202729a57182d2a7`. The feature diff is still the same two files (+187/-6). The regression writes two fragments with `max_rows_per_file = 2`, overlays rows only in fragment 0, and asserts that the untouched fragment is still counted. `id` bytes stay exactly unchanged, and `val` bytes grow by exactly the overlay file's physical column page-buffer bytes measured directly from its raw `FileReader` metadata. On the combined tree: the foreign-root cleanup test with the `aws` feature (1 passed), `dataset::statistics::tests` (2 passed), `dataset::overlay::` (64 passed), `cargo fmt --all --check`, and `cargo clippy --all --tests --benches -- -D warnings`. This remains a per-fragment sum of base and overlay page-buffer bytes for current fields. It is not logical live size or object-store accounting, and excludes footer, manifest, deletion-file, and Blob-sidecar bytes. Unknown and dropped fields remain excluded. --------- Co-authored-by: Xuanwo <[email protected]>
Xuanwo
added a commit
to wjones127/lance
that referenced
this pull request
Nov 15, 2026
…-verdict Integrate the single keep/delete rule with main's bulk deletes (lance-format#10787), transaction and deletion orphan discovery (lance-format#10899) and the foreign-root fixture (lance-format#11095).
Xuanwo
added a commit
that referenced
this pull request
Nov 15, 2026
## Summary
`cleanup_file_if_not_referenced` had a separate copy of the keep/delete
rule for each file kind, and the copies had drifted. This PR splits it
into two steps that apply to every kind and are unit tested without an
object store:
```text
cleanup_file_if_not_referenced(path)
ListedFile::classify(path) -> (kind, FileReference) | None (unmanaged: keep)
ReferencedFiles::contains(ref) -> is_referenced / is_verified
Verdict::decide(is_referenced, is_verified, maybe_in_progress) -> Keep | Delete { unverified }
```
The staging-manifest authority check is now the only per-kind special
case. The new code lives in `cleanup/file_verdict.rs`.
This also fixes the `unverified` drift. A data, index, deletion or
`_fri` file that is old and also referenced by an expiring manifest was
reported as `unverified: true` in `explain()`, and the audit log
recorded it as `delete_unverified`. It now reports as verified, which is
what transaction and `_blobs` files already did. Deletions are
unchanged: the same files get deleted either way.
## Evidence
The new unit tests are tables over path × reference state × age: 27
cases for `classify`, 7 for `decide`, and 18 for key lookup. The
`decide::verified_old` case is the regression test for the drift.
Seven integration tests only checked this rule, so they are removed:
- `cleanup_unreferenced_data_files`
- `do_not_cleanup_newer_data`
- `cleanup_old_index`
- `clean_old_delete_files`
- `dont_clean_index_data_files`
- `dont_cleanup_in_progress_write`
- `orphan_map_ages_out`
Their keep-side checks moved into
`every_removed_file_kind_contributes_its_bytes`, renamed to
`cleanup_keeps_and_removes_every_file_kind`. It now asserts exact
removed and surviving counts for every kind, so a mismatch between the
keys manifests record and the keys `classify` derives from paths is
still caught end to end.
Per-test time from `--test-threads=1 --report-time`, debug build,
measured before the current-`main` integration:
| | Tests | Time |
|---|---|---|
| Rule tests before (8 integration) | 8 | 0.187 s |
| Rule tests after (1 integration + 52 unit) | 53 | 0.075 s |
| Whole `dataset::cleanup` suite, sum of per-test times | 233 → 278 |
8.96 s → 8.85 s |
The rule tests now take 60% less time, but they were already cheap. Over
the whole suite the saving is within run-to-run noise. Most of the
suite's time goes to `branch_lineage` tests (~4.4 s), which this rule
doesn't affect. Parallel wall time is unchanged at about 1.8 s.
## Integration
Merged `main` at `57bd7ff59` with no conflicts, so the rule runs on top
of the landed bulk-delete path (#10787), transaction and deletion orphan
discovery (#10899) and the foreign-root fixture (#11095); their code and
tests are unchanged. On the merged tree `cargo fmt --all --check`,
`cargo check --workspace --tests --benches --profile ci --locked`,
`cargo clippy --all --tests --benches --profile ci --locked -- -D
warnings` and `cargo test --workspace --profile ci --locked` (23,129
passed, 0 failed) pass, as do the 52 rule cases in isolation and
`cleanup_keeps_and_removes_every_file_kind` with its exact per-kind
counts. The timings above were not re-measured after the merge.
## Merge Risk
**Door:** Two-way. No format or API change. But a mistake in this code
would delete live files, and deleted files can't be recovered.
**Blast Radius:** cleanup. Only the `unverified` flag in `explain()` and
the audit-log mode change.
Fixes #10903
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Xuanwo <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cleanup_reclaims_a_parent_blob_named_only_by_a_foreign_rootwrites through a child dataset that carries a foreign S3 base, so the managed-blob writer eagerly builds a store for that base. Without a region in the write params it discovered one with a live S3 HEAD, which timed out on the linux-arm runner and failed the test before its cleanup assertions ran (job 132721154971). The fixture now passes its existing test region and credentials throughWriteParams.store_paramsand reuses them for the later reload; the foreign base path, branch, and the cross-root cleanup assertions are unchanged.The test no longer needs external network access: the full cleanup module (261 tests) completes under
stracewith zeroconnect(2)calls.