Skip to content

feat(transaction): composite transaction foundation (UpdateBases + DataReplacement + Merge)#7834

Draft
wjones127 wants to merge 2 commits into
will/unstable-action-transactions-skeletonfrom
will/oss-1490-composite-transaction-foundation-datareplacement-merge
Draft

feat(transaction): composite transaction foundation (UpdateBases + DataReplacement + Merge)#7834
wjones127 wants to merge 2 commits into
will/unstable-action-transactions-skeletonfrom
will/oss-1490-composite-transaction-foundation-datareplacement-merge

Conversation

@wjones127

Copy link
Copy Markdown
Contributor

Summary

Vertical slice for OSS-1490 (Composite Transactions milestone), sibling to
#7674 (Append + AddIndex) rather than stacked on it: this one decomposes
UpdateBases, DataReplacement, and Merge into action-based transactions,
stacked on the bare skeleton (#7671).

  • New actions: AddBases, ReplaceFragmentColumns (+ColumnReplacement),
    AddFields, ChangeSchema, RefreshRowVersionMetadata, plus a BaseRef
    tagged reference for same-operation base late-binding.
  • apply_user_operation applies them to the in-progress fragment/index
    lists, including covering-index invalidation and dead-data-file pruning.
  • Transaction::actions_from_update_bases/_data_replacement/_merge
    translate the three legacy operations into their action-based equivalent
    (Merge diffs the prior manifest to recover a pure-column-add or recast
    delta).
  • Conflict resolution derives a composite's footprint from its constituent
    actions and reproduces the legacy per-operation rules against every other
    operation kind and against another composite.

Everything is behind the non-default unstable-action-transactions Cargo
feature, as with the rest of this milestone.

Test plan

  • Round-trip parity tests: translate each legacy operation into actions,
    apply, and assert the resulting manifest matches legacy
    build_manifest (covers all-NULL backfill, multi-fragment, and
    stable-row-id refresh cases).
  • Conflict tests: composite vs. every other operation kind, and
    composite vs. composite.
  • cargo fmt --all and cargo clippy --all --tests --benches -- -D warnings, both with and without unstable-action-transactions.

🤖 Generated with Claude Code

wjones127 and others added 2 commits July 17, 2026 16:41
…geSchema/RefreshRowVersionMetadata actions

Extends the experimental Action enum with the actions needed to decompose
the legacy UpdateBases, DataReplacement, and Merge operations:

- AddBases: mint new base paths from the manifest's base-id counter.
- ReplaceFragmentColumns (+ ColumnReplacement): swap or wholesale-replace a
  fragment's data files.
- AddFields / ChangeSchema: append new fields, or replace the schema
  wholesale (for column recasts).
- RefreshRowVersionMetadata: bump row-version metadata for stable-row-id
  datasets.
- BaseRef: a tagged reference (Committed/Local) so a same-operation
  ReplaceFragmentColumns/AddFields can land files on a base minted earlier
  in the same operation, resolved at apply time.

No apply/translation/conflict wiring yet; that follows in the next commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ataReplacement/Merge as composite actions

Wires the new actions through the existing commit path as a feature-gated
Operation::UserOperation variant (opaque wire payload, mirroring the
Append+AddIndex slice's ExperimentalUserOperation hook):

- apply_user_operation resolves AddBases up front (so same-operation
  BaseRef::Local references can be minted before the manifest exists),
  applies ReplaceFragmentColumns (with covering-index invalidation),
  AddFields, ChangeSchema (with dead-data-file pruning), and
  RefreshRowVersionMetadata.
- actions_from_update_bases/actions_from_data_replacement/actions_from_merge
  translate the three legacy operations into their action-based equivalent;
  Merge diffs the prior manifest to recover a pure-column-add or recast
  delta instead of replacing the fragment list wholesale.
- Conflict resolution derives a composite's footprint (added bases /
  replaced fragment-column pairs / merge-class) from its constituent
  actions and checks it against every other operation and against another
  composite, reproducing the legacy UpdateBases/DataReplacement/Merge rules
  per action rather than treating the whole operation as one opaque unit.

Round-trip parity tests assert the composite path produces the same
fragments/schema/indices as the legacy build_manifest for each operation
(including all-NULL backfill, multi-fragment, and stable-row-id cases), and
conflict tests cover composite-vs-legacy and composite-vs-composite.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Important

This PR touches the Lance format specification.

Substantive changes to the format specification — the .proto definitions
and the spec docs under docs/src/format/ — require a PMC vote before merge.
Minor edits such as typo fixes, wording, or formatting are excluded; use your
judgment.

If this is a meaningful format change:

  • Start a vote following the Lance community voting process.
    Format specification modifications need 3 binding +1 votes (excluding the
    proposer), held on GitHub Discussions, with a minimum voting period of 1 week.
  • Once the vote passes, link the completed vote in this PR. It should not be
    merged until the vote is linked.

@github-actions github-actions Bot added A-format On-disk format: protos and format spec docs enhancement New feature or request labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6b012673-2b9e-4bc0-96b5-11e2970594c4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch will/oss-1490-composite-transaction-foundation-datareplacement-merge

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-format On-disk format: protos and format spec docs enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant