Commit f54cde1
## Summary
- Tables corrupted by the bug fixed in #6610 (a deferred-remap
compaction committing concurrently with `optimize_indices` on a stale
handle leaves a user index whose `fragment_bitmap` straddles an FRI
rewrite group) used to panic in `Dataset::load_indices` and were
unreadable.
- `remap_fragment_bitmap` now tolerates the straddle on read: it drops
the indexed old-frag IDs from the bitmap, logs `tracing::warn!`, and
skips the new-frag insertion. Affected rows fall through to flat scan
until the next `optimize_indices`. No data lost; no retrain.
- The fix auto-heals on the next write. `commit_transaction` already
seeds `build_manifest` from `load_indices()`, which now returns the
cleaned bitmaps, so any commit (e.g. `delete("false")`) persists the
corrected manifest. No new API, no user action required.
## Reproduction & test fixture
`rust/examples/src/fri_straddle_datagen.rs` reproduces the corrupt state
deterministically on pre-#6610 builds via the public `plan_compaction` /
`CompactionTask::execute` / `optimize_indices` / `commit_compaction`
APIs. Python can't reach this path — `Compaction.commit` hardcodes
`CompactionOptions::default()` (no `defer_index_remap`) — so the
generator is in Rust. On a fixed build the generator fails loudly on the
conflict-resolver rejection, which is the desired forward-compat
behaviour.
The output is checked in at `test_data/fri_straddle_pre_6610/` and
exercised by `index::tests::test_load_indices_tolerates_fri_straddle`
and `test_auto_heal_persists_cleaned_bitmap`. The latter opens the
fixture, performs a no-op `delete("false")`, and asserts the raw on-disk
`fragment_bitmap` (read via `read_manifest_indexes`) matches the cleaned
bitmap.
## Test plan
- [x] `cargo test -p lance --lib
index::tests::test_load_indices_tolerates_fri_straddle
index::tests::test_auto_heal_persists_cleaned_bitmap`
- [x] `cargo test -p lance --lib index::tests` — 65 passing
- [x] `cargo clippy -p lance --lib -- -D warnings`
- [x] `cargo fmt --all`
## Follow-ups (out of scope)
- Explicit `Dataset::repair()` API for users who want an auditable
trigger / report without writing.
- Better `Dataset::validate()` reporting that surfaces the corruption
explicitly rather than silently healing.
Fixes #6623
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 95a79de commit f54cde1
14 files changed
Lines changed: 7008 additions & 8 deletions
File tree
- rust
- lance-index/src
- lance/src
- test_data/fri_straddle_pre_6610
- datagen
- src
- fri_straddle_dataset
- _indices
- 9026cf25-1429-435c-88b1-760f41784b50
- bd127c0c-fd1a-4c2a-aa2f-3336b3f38f4e
- _transactions
- _versions
- data
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
334 | 344 | | |
335 | 345 | | |
336 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7138 | 7138 | | |
7139 | 7139 | | |
7140 | 7140 | | |
| 7141 | + | |
| 7142 | + | |
| 7143 | + | |
| 7144 | + | |
| 7145 | + | |
| 7146 | + | |
| 7147 | + | |
| 7148 | + | |
| 7149 | + | |
| 7150 | + | |
| 7151 | + | |
| 7152 | + | |
| 7153 | + | |
| 7154 | + | |
| 7155 | + | |
| 7156 | + | |
| 7157 | + | |
| 7158 | + | |
| 7159 | + | |
| 7160 | + | |
| 7161 | + | |
| 7162 | + | |
| 7163 | + | |
| 7164 | + | |
| 7165 | + | |
| 7166 | + | |
| 7167 | + | |
| 7168 | + | |
| 7169 | + | |
| 7170 | + | |
| 7171 | + | |
| 7172 | + | |
| 7173 | + | |
| 7174 | + | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
| 7178 | + | |
| 7179 | + | |
| 7180 | + | |
| 7181 | + | |
| 7182 | + | |
| 7183 | + | |
| 7184 | + | |
| 7185 | + | |
| 7186 | + | |
| 7187 | + | |
| 7188 | + | |
| 7189 | + | |
| 7190 | + | |
| 7191 | + | |
| 7192 | + | |
| 7193 | + | |
| 7194 | + | |
| 7195 | + | |
| 7196 | + | |
| 7197 | + | |
| 7198 | + | |
| 7199 | + | |
| 7200 | + | |
| 7201 | + | |
| 7202 | + | |
| 7203 | + | |
| 7204 | + | |
7141 | 7205 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments