Skip to content

test: characterize legacy conflict resolution end to end - #9220

Merged
Xuanwo merged 10 commits into
lance-format:mainfrom
wjones127:will/legacy-conflict-characterization
Nov 2, 2026
Merged

Xuanwo merged 10 commits into
lance-format:mainfrom
wjones127:will/legacy-conflict-characterization

Conversation

@wjones127

@wjones127 wjones127 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Tests only. This adds an end-to-end behaviour baseline for conflict resolution between concurrent transactions, so changes to the legacy rules can be checked against the manifests and rows they produce rather than only against check_txn verdicts.

Each case stages a real transaction through a production write path, commits a second transaction underneath it, then commits the first for real. The matrix covers ordered pairs of the existing operation vocabulary and exercises both fragment and field footprints. Every landed result is checked for manifest validity, rollback-sensitive invariants, scanability, and, where the measured legacy behaviour is serializable, equality with serial execution.

The expectations describe current legacy behaviour. Known snapshot-isolation divergences remain explicit exemptions; this does not add configurable isolation levels or change the resolver. It includes regressions for #9216, #9217, #9313, and #9724, with no remaining excluded cells.

The fixture remains six rows across two fragments. Two ignored discovery tests regenerate the verdict and footprint matrices when an intentional behaviour change lands.

The existing matrix in `conflict_resolver::tests::test_conflicts` builds
`TransactionRebase` as a struct literal over bare `Fragment::new(0)` values,
calls `check_txn`, and asserts the verdict. It never calls `finish`, so no
manifest is ever built. That pins the verdict table and can observe nothing
downstream of it: the second phase, the resulting manifest, or anything
depending on real fragment contents.

Add a suite on the other axis. Each case stages a real transaction through a
production write path, lets a second transaction commit underneath it, then
commits it for real -- so the assertion is about the manifest and the rows a
reader gets back, not an intermediate verdict.

- `scenarios.rs` stages twelve operations, using the uncommitted builders
  (`InsertBuilder`, `DeleteBuilder`, `MergeInsertBuilder`, `CreateIndexBuilder`,
  `FileFragment::write_overlay`) wherever one exists.
- `invariants.rs` holds six properties checked after every landing, stated over
  observable dataset state rather than resolver internals.
- `cases.rs` holds all 144 ordered pairs. Ordered, not unordered: the legacy
  matrix is asymmetric in many places, and a harness that loops
  `[(a, b), (b, a)]` against one expectation cannot express that.

Expectations are filled in from observed behaviour via the `discover` tool, not
derived from reading match arms.

Four cells are excluded and written up as `#[ignore]`d tests against tracking
issues, because what the code does with them today is wrong:

- lance-format#9216 -- a `Delete` drops a concurrently committed `DataOverlay`. The overlaid
  cell reverts to its base value, visible from a plain scan.
- lance-format#9217 -- `Delete` and both `Update` modes reinstate a data file a concurrent
  `Project` pruned, leaving a file the schema cannot reach.

The whole suite runs in ~0.3s.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@github-actions github-actions Bot added the chore label Sep 14, 2026
@wjones127

Copy link
Copy Markdown
Contributor Author

Decision

Characterization suite for legacy conflict resolution, landing on main rather than inside the Transaction V2 stack, asserting on committed manifests and scan results rather than on check_txn verdicts.

Status

Settled 2026-09-14. Implemented in this PR.

Options and criteria

The acceptance criterion is that this suite must pass unchanged when the TV2 stack merges. If it doesn't, the stack changed legacy behaviour, and that is the signal we want. So assertions are over observable state — the manifest a reader loads and the rows a scan returns — never over TransactionRebase's internals, which the stack may reshape freely.

  • How to express cells that are wrong today. Chosen: exclude them from the matrix and write each up as an #[ignore]d test asserting the correct behaviour, against a filed tracking issue (bug: a legacy Delete drops a concurrently committed DataOverlay #9216, bug: a legacy Delete reinstates a data file a concurrent Project pruned #9217). Rejected below.
  • Operation scope. Chosen: twelve scenarios — ten fragment-touching operations (Update counted twice, once per mode) plus the state-replacing Overwrite and Restore. 144 ordered pairs. Overwrite/Restore need per-op exemptions from the monotonic invariants, modelled as Scenario::replaces_state().
  • Where it lives. In-crate at rust/lance/src/io/commit/conflict_matrix/, not under tests/: staging uncommitted transactions and inspecting manifests both need crate internals. Its own module rather than conflict_resolver.rs, which is already 5,657 lines.

Rejected, with the reason and when it was tried

  • A KnownWrong(&'static str) fourth Outcome variant recording today's broken behaviour as a green assertion. Rejected 2026-09-14 (Will). It makes the matrix assert that the bug is still present, so the fix has to edit the table to land. #[ignore] + a tracking issue matches the repo convention and keeps the assertion pointed at the behaviour we want.
  • Invariant "max_field_id is non-decreasing across versions" (from the original design sketch). Rejected 2026-09-14 after measuring: a plain Project legitimately decreases it, so the invariant fires with no conflict involved.
  • Invariant "every DataFile.fields id appears in the manifest schema". Rejected same day, same reason: a projection prunes a data file only when all of its fields go away, so a file legitimately retains a dropped field. Verified against a single-fragment Project with no concurrency — schema [0], file [0, 1]. Replaced by the weaker, true form: no data file may have all of its field ids absent from the schema. That is what catches bug: a legacy Delete reinstates a data file a concurrent Project pruned #9217.
  • Invariant "the max_field_id watermark covers every schema field id", written and then removed before commit. It cannot fail: Manifest::max_field_id() is defined as max(schema_max, fragment_max), so the property holds by construction.
  • Narrower first wave (six operations, ~36 pairs). Rejected 2026-09-14 (Will) in favour of the wider cut; the runtime cost turned out to be negligible (~0.3s for the whole suite).

Open questions

  • Two scenarios are hand-assembled because no uncommitted builder exists: Update { RewriteColumns } and Merge. They are built from state read out of the fixture rather than from placeholder fragments, and scenario_lands_uncontended checks each is sound on its own — but they are the two most likely to drift from what production actually emits.
  • Changing the RewriteColumns fixture to target column c (it must: a and b share a data file, and replacing that file with a b-only one orphans a) moved (UpdateRewriteColumns, DataOverlay) and (DataReplacement, UpdateRewriteColumns) from Retryable to Lands, because the fields no longer overlap. The field-overlap retry path is therefore no longer covered for those pairs. Worth a second overlay scenario later.
  • tombstones_stay_tombstoned is vacuous today — only the action vocabulary tombstones. Kept deliberately so it starts biting when that lands.
  • CompositeOperation, Clone, UpdateConfig, UpdateBases, ReserveFragments and UpdateMemWalState are not scenarios. The first belongs to the planned cross-form PR; the rest have no fragment interaction.

/// dropped, because a projection only prunes a file when *all* of its fields go
/// away. Asserting the stronger "every field id appears in the schema" would
/// fire on an ordinary single-fragment projection with no conflict at all.
fn no_orphaned_data_file(after: &Dataset, context: &str) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: some of these tests looks like they just duplicate Dataset::validate(). Perhaps we should just re-use that for parts of the invariant validations.

The suite asserted that a rebased dataset was structurally coherent, but
nothing about the rows it held: the only row-count check compared a scan
against the manifest's own accounting, which is self-referential. A rebase
producing the right number of valid rows with the wrong values in them
passed.

Add `oracle`, which re-runs each pair serially from a fresh fixture and
compares the full content. That is a serializability check, so the pairs
where snapshot isolation legitimately diverges are listed with the reason.
Its first run found one: a data replacement deliberately keeps an overlay
committed after its own snapshot, because that overlay is the newer value,
while serial execution lets the replacement win the cell.

Name the level those expectations are stated under. Legacy conflict
resolution is not uniformly any textbook level, so `Isolation::Legacy`
records what the code does rather than claiming a contract. When levels
become configurable the grid gains a dimension and each exemption becomes a
per-level rule.

Replace the 390-line expectation table with a parsed grid, so the whole
matrix reads at a glance and regenerating it produces a reviewable diff.
`discover` emits the same format.

Delegate to `Dataset::validate`, dropping `no_orphaned_data_file` — which
`FileFragment::validate` already covers against real IO — and gaining
fragment ordering, per-file length agreement and deletion-vector
cardinality. Turn stable row ids on in the fixture so its row id invariants
are live; that needs `stage_rewrite` to transfer row ids the way compaction
does, so widen `rechunk_stable_row_ids` rather than reimplement it. No
expectation moved.

Give synthetic data files unique names. The fixed name was benign only while
every staging wrote identical contents.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wjones127

Copy link
Copy Markdown
Contributor Author

Decision

Four changes in e7403aa, in response to review:

  1. A content oracle (oracle.rs). Each landing is re-run serially from a fresh fixture — commit theirs, then stage and commit ours on top, so nothing rebases — and the full content is compared as an order-independent, all-columns fingerprint. This replaces nothing; it covers the gap that dataset_scans only compared a scan against the manifest's own accounting, which is self-referential.
  2. Isolation::Legacy, a one-variant enum naming the level the grid and the oracle are stated under.
  3. The expectation table is now a parsed grid, not 390 lines of tuples.
  4. Dataset::validate() replaces no_orphaned_data_file, and the fixture enables stable row ids so validate()'s row id invariants are live.

Status

Committed and pushed. 25 tests, 4 ignored, 0.35s (was 0.30s). cargo clippy -p lance --tests clean. All 156 io::commit tests pass. discover regenerates the checked-in grid byte-identically.

Options and criteria

Oracle framing. Stated as a serializability check with an explicit exemption list, rather than as an ad-hoc set of per-pair expected values. Criterion: Lance intends to offer configurable isolation levels with serializable among them, so this is that conformance check built early and pointed at legacy. The exemption list is then not debt — it is the measured gap between legacy and serializable, which is an input the levels work needs.

Its first run fired on exactly one cell of 140: (data_replacement over data_overlay). That is correct-by-design and documented at the source — manifest_build.rs partitions overlays on committed_version <= read_version and deliberately keeps an overlay committed after the replacement's snapshot, because it is the newer value. Serial execution puts the replacement last, so the replacement wins the cell instead. Recorded in EXEMPT with that reasoning.

Grid as source of truth, not a rendering. The grid is parsed at run time and matrix_is_total cross-checks its ! cells against KNOWN_BUGS. Criterion: two encodings that must agree is a maintenance hazard; the grid earns its place only if there is exactly one place to read and one to change.

Stable row ids on. Measured rather than argued: flipping the flag failed 13 of 25 tests, all from stage_rewrite, which assembled Operation::Rewrite without the row id transfer real compaction does. Fixed by widening rechunk_stable_row_ids to pub(crate) and calling it. No expectation moved — legacy conflict verdicts are identical with and without stable row ids for these 12 scenarios.

Rejected, with the reason and when it was tried

  • Clone as a 13th scenario — rejected on inspection. manifest_build returns Error::internal("Clone operation should not enter build_manifest") unconditionally; Clone's manifest is built only from do_commit_new_dataset, so it cannot be staged against an existing dataset. Worth noting the conflict machinery still returns Ok(()) for it unconditionally, i.e. its "never conflicts" verdict is vacuous.
  • Reimplementing the row id rechunk inside the stager — rejected in favour of widening the production function. The reimplementation would have deepened exactly the hand-assembled-scenario drift that caused the failure.
  • A write_params_for helper threading the row id flag through the stagers — written, then removed: InsertBuilder already coerces enable_stable_row_ids to the target dataset, so it forwarded without adding anything.
  • A snapshot framework (insta, expect-test) — rejected; neither is in the workspace, and the repo's convention is an inline raw string with pretty_assertions.
  • Keeping the tuple table alongside the grid — rejected as two encodings that must agree.

Open questions

  • Footprint is still a fixed constant, not an axis. Nearly every fragment-scoped scenario targets fragment 0, so the matrix is saturated with the overlapping case and close to blind to the disjoint one. This matters for the footprint-algebra PR, whose claim is that it permits what legacy wrongly rejects. Not addressed here.
  • One instance per operation, so one branch per operation. The delete is a single row and never populates deleted_fragment_ids, leaving several check_delete_txn arms unreachable — including one where a whole-fragment delete should flip (data_replacement, delete) from Lands to Incompatible.
  • Two dead global pre-checks. may_alter_nullability is true only for Project/Merge with preserves_nullability: false, and updates_schema_or_field_metadata only for UpdateConfig. Both stagers hard-code the former to true and no scenario emits the latter, so both pre-checks are unreached in all 144 cells.
  • Rewrite never carries rewritten_indices or a frag-reuse index, collapsing a four-arm match to one and making finish_rewrite a no-op.
  • N-way concurrency, alternate storage formats. Out of scope; a pair harness is the wrong shape for a chain.

🤖 Generated with Claude Code

wjones127 and others added 2 commits September 16, 2026 11:03
Three checks in the conflict resolver were unreachable in all 144 cells,
because every scenario happened to pick the same side of them.

`may_alter_nullability` is true only for a Project or Merge that does not
assert `preserves_nullability`, and both stagers hard-coded it true. It gates
a global pre-check that fires in either order against anything supplying
values. Stage both settings.

`updates_schema_or_field_metadata` is true only for an UpdateConfig carrying
schema or field metadata, and no scenario emitted one. It gates the other
global pre-check, against Merge. Add UpdateConfig as a scenario, updating
schema metadata rather than config entries, which is what the pre-check keys
on.

A delete whose predicate covers a whole fragment populates
`deleted_fragment_ids` instead of `updated_fragments`, which several arms key
on; the existing single-row delete never did. Add it as its own scenario, and
assert the shape so a fixture change cannot silently turn it back into an
ordinary delete.

All four change observed behaviour rather than merely reaching new code.
Notably `(data_replacement, delete_whole_fragment)` is incompatible where
`(data_replacement, delete)` lands — a verdict change, not just a different
arm — and the nullability column turns eight cells retryable that were
landing.

It also widens a known bug: `(delete, project_alter_nullability)` reinstates a
pruned data file through the same apply arm as `(delete, project)`, so lance-format#9217
costs one more cell than recorded.

The matrix is now 16x16. 33 tests, 0.42s.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Every scenario in the matrix staged against fragment 0, so every
fragment-scoped pair in it overlapped. That made the suite a good detector of
under-rejection and a poor one for the opposite mistake: a conflict resolver
that rejected everything outright would have scored nearly as well as one that
reasons about footprints, because the matrix never asked a question whose
answer depended on the footprint.

Add `Footprint`, which says which fragment `theirs` touches, and a second grid
over the eight fragment-scoped operations recording both answers per pair.
Thirty of the sixty-four cells differ between the two, so legacy does resolve
most of these by footprint; three reject on opcode alone, which is now
recorded rather than unasked. `(data_replacement, delete_whole_fragment)` is
incompatible when the two overlap and lands when they do not.

Scope `stage_create_index` to a single fragment. A whole-dataset index has no
footprint to compare, and `fragment_bitmap` is what the rewrite arms of
`check_create_index_txn` key on. No cell in the existing matrix moved.

Fix the oracle to stage `theirs` at the footprint under test. It re-staged at
the default, so the serial comparison ran a different pair of operations than
the rebase it was checking.

Field-level overlap is deliberately not covered: it only means anything for
the three field-scoped operations, and the fixture cannot express it cleanly
while `a` and `b` share a data file. Stated in the module docs rather than
approximated.

42 tests, 0.66s.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wjones127

Copy link
Copy Markdown
Contributor Author

Decision

Two more commits: ff1b3b5 closes the branch-coverage gap, 9d3ee26 adds the footprint axis.

Branch coverage. Three checks in the resolver were unreachable in all 144 cells because every scenario happened to pick the same side of them. All four new scenarios change observed behaviour rather than merely reaching new code:

  • preserves_nullability: false on Project and Merge — gates may_alter_nullability, whose global pre-check fires in either order against anything supplying values. Eight cells that were landing are now retryable.
  • UpdateConfig carrying schema metadata — gates updates_schema_or_field_metadata, the other global pre-check, against Merge. Config entries alone do not reach it.
  • A delete covering a whole fragment — populates deleted_fragment_ids instead of updated_fragments. (data_replacement, delete_whole_fragment) is incompatible where (data_replacement, delete) lands: a verdict change, not just a different arm.

Matrix is 16×16.

Footprint. ours always works on fragment 0; theirs is now staged at the same fragment and again at a disjoint one, over the eight fragment-scoped operations. The second grid records both answers per pair.

Thirty of sixty-four cells differ between the two footprints, so legacy does resolve most of these by what the operations touch. Three reject on opcode alone — (data_replacement, create_index), (create_index, data_replacement), (create_index, create_index) — which is now recorded rather than unasked, and is the set worth revisiting when footprint algebra lands.

Status

Pushed. 42 tests, 5 ignored, 0.66s. cargo clippy -p lance --tests clean; all 173 io::commit tests pass. Both grids regenerate byte-identically from their discover tools.

Options and criteria

Footprint is fragment-level, not field-level. Criterion: fragment-level is cleanly defined for all eight fragment-scoped operations, while field-level only means anything for three of them, and the fixture cannot express it while a and b share a data file. Stated in the module docs as a follow-up rather than approximated.

A second grid rather than a third dimension on the first. Footprint is meaningless for the eight dataset-scoped operations — they produce the same transaction whichever fragment they are pointed at — so folding it into the main matrix would have doubled its runtime to assert nothing on half the cells.

stage_create_index is now scoped to one fragment. A whole-dataset index has no footprint to compare, and fragment_bitmap is what the rewrite arms of check_create_index_txn key on. No existing cell moved.

Rejected, with the reason and when it was tried

  • Fragment-1 variants of each scenario as extra rows/columns, instead of a footprint parameter — rejected: it would have produced redundant cells (ours@f1 against theirs@f1 re-asks the overlapping question) and a 24×24 grid.
  • Column codes pn/mn — the typos pre-commit hook rewrites pn to on. Renamed to pa/ma.

Found while building

  • bug: a legacy Delete reinstates a data file a concurrent Project pruned #9217 costs one more cell than recorded. (delete, project_alter_nullability) reinstates a pruned data file through the same apply arm as (delete, project). Only delete reaches it; both update modes are held off by the nullability pre-check.
  • The oracle had a defect the footprint axis exposed: serial_execution re-staged theirs at the default footprint, so it compared a different pair of operations than the rebase it was checking. Fixed.
  • stage_update_rewrite_columns ignored its fragment argument, which showed up as a column with no footprint sensitivity at all. Caught by an unused-variable warning.

Open questions

  • Field-level footprint, as above. Needs a fourth column with a data file to itself.
  • Rewrite still never carries rewritten_indices or a frag-reuse index, collapsing a four-arm match to one and making finish_rewrite a no-op.
  • CreateIndex never replaces an existing index, so has_append_drop_conflict and has_replaced_identity_conflict are never evaluated.
  • N-way concurrency and alternate storage formats remain out of scope.

🤖 Generated with Claude Code

The footprint axis could previously only vary the fragment, because the
fixture had exactly one column a scenario could target without disturbing
another. A resolver that reasons about fragments but not fields would have
scored perfectly on it.

Add a fourth column `d`, in a data file of its own, and a third footprint
`OtherField`: same fragment 0, column `d` instead of `c`. The three
field-scoped stagers take the column as a parameter, and all of them now
default to `c` — `data_overlay` moves off `b`, and `data_replacement` moves
off the file `a` and `b` share, which also stops it rewriting the column the
content oracle keys on.

What it found, in the regenerated grid: field sensitivity is rare. Most
fragment-scoped pairs read `R/R/L` — they distinguish fragments and not
fields. Only three cells reason about columns at all.

`project` and `merge` now drop just `c`, keeping `d`. Dropping both left `d`'s
data file on a fragment whose schema no longer had `d`, which `Dataset::validate`
correctly rejected — with no concurrency involved.

Excludes two more cells, against a new bug the `d` column surfaced:
`Operation::Project` prunes the data files of the columns it drops but never
their overlays, leaving an overlay nothing will read and cleanup will not
collect (lance-format#9313). Reproduces serially; recorded here because it is what makes
the two data_overlay/project cells unassertable.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@wjones127

Copy link
Copy Markdown
Contributor Author

Field-level footprint

Decision

The footprint axis varies three footprints, not two: Same (fragment 0, column c), OtherField (fragment 0, column d), OtherFragment (fragment 1, column c). The fixture gained a fourth column d in a data file of its own to make OtherField expressible.

Footprint::OtherField applies only to the three field-scoped scenarios (update_rewrite_columns, data_overlay, data_replacement); everything else produces the same transaction whichever column it is pointed at, and those cells are - in the grid rather than run. footprint_matrix_is_total holds the - cells to Scenario::is_field_scoped so the exclusions cannot drift.

Status

Landed in 0fe5b10b6. 42 tests, ~0.8s. Both discover tools verified to regenerate their grids byte-identically.

What it found

Field sensitivity is rare. Most fragment-scoped pairs read R/R/L — legacy distinguishes fragments and not columns:

                       | dl      df      ur      uc      ov      dr      ci      rw
delete                 | R/-/L   R/-/L   L/-/L   R/R/L   !/!/!   R/R/L   L/-/L   R/-/L
delete_whole_fragment  | R/-/L   R/-/L   R/-/L   R/R/L   L/L/L   R/R/L   L/-/L   R/-/L
update_rewrite_rows    | L/-/L   R/-/L   R/-/L   R/R/L   R/R/L   R/R/L   L/-/L   R/-/L
update_rewrite_columns | R/-/L   R/-/L   R/-/L   R/R/L   R/L/L   R/R/L   L/-/L   R/-/L
data_overlay           | L/-/L   R/-/L   R/-/L   L/L/L   L/L/L   L/L/L   L/-/L   R/-/L
data_replacement       | L/-/L   X/-/L   R/-/L   R/L/L   L/L/L   R/L/L   L/-/L   R/-/L
create_index           | L/-/L   L/-/L   L/-/L   L/L/L   L/L/L   L/L/L   R/-/R   R/-/L
rewrite                | R/-/L   R/-/L   R/-/L   R/R/L   R/R/L   R/R/L   R/-/L   R/-/L

Exactly three cells reason about columns: update_rewrite_columns over data_overlay, and data_replacement over update_rewrite_columns and over data_replacement. Everything else that rejects at Same rejects at OtherField too. Whether that conservatism is worth relaxing is a question for the isolation-levels work; it is now recorded rather than unasked.

New bug: #9313

Adding d surfaced a defect that has nothing to do with conflict resolution. Operation::Project prunes the data files whose fields all went away but applies the same rule to fragment.overlays nowhere, so a projection leaves behind an overlay supplying only dropped columns — unreadable, and not collectable by cleanup. It reproduces with no concurrency at all: overlay commit, then projection.

Two cells (data_overlay/project, both orders) are excluded against it, with an #[ignore]d test asserting the correct behaviour serially, matching how #9216/#9217 are handled.

Rejected, with the reason and when it was tried

  • Leave project/merge projecting to ["a", "b"]. Tried first, when d was added. It dropped both c and d from the schema while merge's stager pruned only c's file, leaving d's file on a fragment whose schema no longer had d. Dataset::validate rejected it, correctly, in scenario_lands_uncontended with no concurrency — which is exactly the class of defect the Dataset::validate delegation was added for. Both now project to ["a", "b", "d"] and drop c alone, which still prunes a whole file and so still reproduces bug: a legacy Delete reinstates a data file a concurrent Project pruned #9217.

  • Keep data_overlay on column b. It would have sidestepped bug: Project leaves overlays behind for the columns it drops #9313 by never overlaying a column a projection drops, but only by making the overlay and the rest of the suite disagree about which column is "the" target, and b shares a file with a so it cannot serve as a footprint at all.

  • Box oracle::check at each call site for clippy::large_futures. The fourth column pushed run itself over the limit, so the warning moved to all four of its callers. Boxed once at run's definition instead — one comment rather than four.

Open questions

  • The three field-sensitive cells all involve update_rewrite_columns or data_replacement. Whether the other R/R/L cells are conservative on purpose or by omission is not something this suite can answer; it only records which they are.
  • KNOWN_BUGS is keyed on the pair, not the pair-and-footprint, so a bug that only reproduces when footprints overlap exempts the disjoint cells too. footprint_matrix_is_total requires all three to be excluded together so this stays visible, but a per-footprint key would be more precise if the exclusion list grows.

…#9217, lance-format#9313

Expose rechunk_row_lineage (main's replacement for rechunk_stable_row_ids)
for the rewrite scenario. Un-ignore the three fixed-bug tests as regression
tests and regenerate both grids. The (data_overlay, project) cell stays
excluded under lance-format#9724, which lance-format#9314 did not cover.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@wjones127
wjones127 marked this pull request as ready for review October 5, 2026 22:10

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Oct 5, 2026
Xuanwo pushed a commit that referenced this pull request Oct 23, 2026
…s its field (#10123)

Closes #9724.

A `DataOverlay` staged at version N still committed after a concurrent
`Project` at N+1 dropped the field it overlays. `check_data_overlay_txn`
treated every `Project` as compatible, and the overlay build arm doesn't
look at the schema, so the overlay landed covering only fields that no
longer exist. #9314 handles the other order, where `Project` prunes
overlays that are already committed.

This makes `Project` a retryable conflict for an overlay when the
projected schema no longer contains one of the overlay's fields, which
is the first option the issue gives. A projection that keeps all of the
overlay's fields (a rename, or dropping some other column) is still
compatible.

Testing: `test_data_overlay_conflicts` gained two `Project` cases, one
keeping the overlaid field (compatible) and one dropping it (retryable).
The dropping case fails on main. `cargo test -p lance --lib
io::commit::conflict_resolver` and `cargo test -p lance --lib overlay`
pass, `cargo fmt --all` is clean, and `cargo clippy -p lance --lib
--tests -- -D warnings` passes; I didn't run the full-workspace clippy.

#9220 leaves the `(DataOverlay, Project)` cell out of its conflict
matrix because of this bug; with this change it should be able to go
back in.

I used an AI coding assistant to help write this change and the test; I
reviewed the diff and ran the checks above.
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 2, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Gate recommendation: approve.

This closes the gap between conflict verdict tests and the manifests and rows readers actually see. The previously excluded overlay/projection case is now active: #10123 is merged into the base and rejects overlays for dropped fields.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 2, 2026

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving head bdb88ba653a28b754cfb5624d087330b14fa20f5 after the complete Rust, Python, and Java CI set passed.

The reviewed feature diff is unchanged from the Gatekeeper-approved revision; the latest main integration only brings in the repaired compatibility test. The matrix retains manifest, scan, rollback-sensitive, and serial-content assertions, including the restored #9724 regression.

@Xuanwo
Xuanwo merged commit 188f734 into lance-format:main Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants