Repository navigation
refactor: reuse format transaction conversion in commit paths - #11390
Merged
Merged
Conversation
The detached retry and the injected foreign-commit test rebuilt the format wrapper from its protobuf form by hand. Use the existing `format::Transaction::try_from` conversion instead, matching the namespace commit path. Also correct the wrapper documentation: it is the optional protobuf carrier passed to commit handlers and the manifest writer, not a crate-local transaction representation.
The wrapper holds a protobuf message in memory; the manifest writer serializes it with `write_protobuf`. Public `inner` and `From<pb::Transaction>` also allow direct construction, so remove the claim that the wrapped message was validated. The reverse `From` only moves the message out.
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 23, 2026
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.
Summary
Use the existing
lance_table::format::Transaction::try_from(&Transaction)conversion in the two places that rebuilt the format wrapper by hand:Also correct the
format::Transactiondocs. The wrapper holds apb::Transactionmessage in memory; the manifest writer serializes it atwrite_protobuf. BecauseinnerandFrom<pb::Transaction>are public, wrapping does not imply validation. The reverseFromonly moves the message out without another conversion.Behavior and compatibility
lance_table::format::Transaction,inner,as_pb,CommitHandler, andManifestWriterare unchanged..txnfile is still written once before the retry loop.Validation
cargo fmt --all -- --checkcargo clippy --all --tests --benches --profile ci -j 8 -- -D warningscargo test -p lance-table --lib --profile ci format::transaction: 4 passedcargo test -p lance --lib --profile ci -j 1 --no-runlink; 18 targeted runtime tests passed from the same binary:There is no deterministic test for the detached random-version collision retry itself; that branch is compile-covered, and the same conversion is exercised by the injected foreign-commit tests. The detached first-attempt path is covered by
test_list_detached_manifests.No diff overlap with #11232 (inline toggle), #11021 (expected-head mode), or #11280 (test metadata); none changes these conversion sites.