Skip to content

Spike: Action-level conflict resolution design #6448

@wjones127

Description

@wjones127

Parent PRD

Milestone: Action-based Transactions (UserOperation) — see milestone description for full PRD.
Discussion: #5960

Anchor design

A draft design exists on a prototype branch:
rust/lance-table/design/action_based_conflict_resolution.md.

This spike adopts that doc as its starting point. The work here is to land
the doc in-tree, fill out its TODO sections (§4 catalog, §5 matrix,
§6 rules, §8 payloads, §11 migration), and resolve its open questions.

What to build

Design how conflict resolution works at the Action level rather than the
Operation level. The new system must detect conflicts and rebase using only
Action types and payloads — no higher-level operation intent.

Three design patterns from the doc anchor the rest of the work and must
be confirmed or revised in this spike:

  1. Criterion-based targeting (§3.1) — actions targeting open sets carry
    predicates over (fragment_ids, field_ids, ...), not identity lists.
    Motivating case: Update on column X || concurrent AddIndex on column X.
  2. Late binding of action output (§3.2) — payloads use FragmentTemplate
    (no id) rather than Fragment. IDs assigned at apply time from manifest
    counters. Rebase becomes a no-op for produced IDs.
  3. Symbolic intra-transaction references (§3.3) —
    FragmentRef::ProducedBy { action_idx, output_idx }, resolved through
    TxnContext as the driver walks the action list. Pins compound-txn
    dependencies to an ordered list, not a DAG.

These three together change the shape of the Action trait from the
current apply(&Manifest) + conflicts_with(&other) pair to a five-method
contract (reads/writes/validate/rebase/apply) plus a driver loop
that uses mask intersection to gate rebase. This is the most consequential
piece for #6450#6453 to be designed against.

Catalog reconciliation (must do before #6451/#6452 land)

The milestone PRD's 14-action catalog and the design doc's §4 catalog
disagree on three concrete points. This spike must resolve them so
implementation issues design against the right shape:

Topic Milestone PRD Design doc §4 Resolution needed
Single-fragment updates UpdateFragment(Fragment) (omnibus: deletion files, replaced columns, swap data files) Split into UpdateDeletionVector, ReplaceFragmentColumns, RewriteFragments Decide whether to split. If yes, migrate #6450's shipped UpdateFragment to UpdateDeletionVector (the only translation that landed — Delete — used it that way).
Index coverage AddIndex / RemoveIndex only Plus InvalidateIndexCoverage, RebindIndexCoverage, RegisterFragReuse Decide whether to add the three coverage actions. Required to express open-set cross-resource cases (§3.1).
Compact distinction RemoveFragments + AddFragments RewriteFragments (asserts data equivalence; enables index salvage via RebindIndexCoverage) Decide whether RewriteFragments warrants its own action.

Acceptance criteria

Out of scope

Blocked by

None — can start immediately.

Blocks

User stories addressed

  • User story 6: single code path for conflict resolution

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions