Repository navigation
Conversation
adc53c8 to
7955145
Compare
7955145 to
27528dd
Compare
This comment has been minimized.
This comment has been minimized.
27528dd to
5f22f73
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
5f22f73 to
0f01a7c
Compare
0f01a7c to
3d216aa
Compare
f565438 to
57bd279
Compare
57bd279 to
4e0e871
Compare
4e0e871 to
a25511e
Compare
a25511e to
f6b4c20
Compare
f6b4c20 to
3d7ac29
Compare
geruh
left a comment
There was a problem hiding this comment.
Mostly LGTM, I've been testing on top with the staged work and left a few comments on stuff i ran into.
I think these can be addressed here or in followups im fine either way
| .sources | ||
| .iter() | ||
| .map(|&id| { | ||
| let fragment = self |
There was a problem hiding this comment.
Should we use the source fragment as earlier actions left it, or reject a source that was already modified before removal?
this function reads from the current_manifest fragments while something like remove fragments can throw awat the working fragment If SetDeletionFile runs before compaction on that same fragment, we end up counting the old surviving rows. This rejects a compaction that drops the deleted row while allowing one that keeps it.
lance/rust/lance-table/src/transaction/action/apply.rs
Lines 649 to 656 in d24bd75
An AddOverlays after compaction would also miss the overlay check because the original fragment had no overlays.
There was a problem hiding this comment.
Good catch. Fixed in 061ea57: remove_fragment now records whether the fragment still matches the committed one, and AppendFragReuseTransition rejects a source this operation modified before removing it (covers deletions, overlays, and in-place rewrites). Tests: the source_given_a_deletion_earlier_in_the_operation / source_given_an_overlay_earlier_in_the_operation cases of test_a_transition_apply_rejects, plus test_a_transition_beside_a_change_to_another_fragment for the untouched-source case. If a real use case appears, a more robust approach (digesting the source as removed) can follow.
| .iter() | ||
| .filter_map(|fragment| u32::try_from(fragment.id).ok()) | ||
| .collect(); | ||
| Transaction::withdraw_in_place_rewrites( |
There was a problem hiding this comment.
rebind_fields only prunes segments present when the rewrite happens, but finish_frag_reuse_history applies rebound_fields to the final index list.
On a table with tagged history, a rewrite followed by AddIndexSegment drops coverage for the rewritten fragment even though the segment was added afterward. We could probably skip segments added after the rewrite here?
There was a problem hiding this comment.
Will do this in a follow-up.
| @@ -1648,6 +1643,42 @@ async fn build_config_for_attempt( | |||
| Ok(config) | |||
There was a problem hiding this comment.
I think here we should also load spilled row lineage for composite operations here?
this method only handles Update and DataOverlay, so a composite with AddOverlays or a partial RefreshRowVersionMetadata won't load the existing row versions. If those versions have spilled, the action fails because the metadata wasn't loaded before the commit.
The AddOverlays test supplies config.spilled_row_lineage manually, so it doesn't catch this.
lance/rust/lance-table/src/transaction/action/add_overlays.rs
Lines 587 to 600 in d24bd75
There was a problem hiding this comment.
Will do this in a follow-up.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed earlier in the operation Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he operation The source digest is read from the committed fragment, so a deletion, overlay, or in-place rewrite applied to a source before its removal made the digest stale. Such sources are now rejected. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
The source-state blocker is fixed: recorded compactions now reject a source changed earlier in the same operation. No blocker remains.
Two bounded limitations remain: tagged-history coverage pruning can cause unnecessary scan fallback, and missing spilled-lineage loading can reject composite overlays or partial row-version refreshes. Use the legacy path for affected spilled-lineage updates.
geruh
left a comment
There was a problem hiding this comment.
Thanks for addressing comments!
BREAKING CHANGE:
lance_table::transaction::action::Actiongains theAddOverlays,RefreshRowVersionMetadata,UpdateCompactedSsTables,AssertUniqueKeys,AssertCellsUnchanged,AppendFragReuseTransition, andTrimFragReusevariants, andCoordinategainsFragmentRowVersions, so exhaustive matches on them must handle the new variants.Stacked on #8645. Implements the rest of the Transaction V2 vocabulary and lowers
DataOverlay,UpdateMemWalState, and the vertical form ofUpdateonto it. With this every specified action is implemented. No format change: the wire shapes are in #7954. Supersedes #8632.Example
Appending rows and asserting their keys are new, in one commit. A concurrent insert that doesn't say which keys it carries makes this conflict, since there is nothing to compare against:
Conflict rules
Overlays are partial writes of a field in a fragment. Two overlays commute (the newer
committed_versionwins each cell), and so does an overlay with a re-encode, which keeps row offsets. A full rewrite of the column conflicts in either order, as does a row-moving update, which would re-create the rows without the overlay's values.Key assertions are preconditions, not changes. Keys are user-supplied, so two writers can insert the same key into their own fragments with disjoint coordinates. The manifest doesn't record which keys exist, so
AssertUniqueKeyscarries the merge insert's key-hash filter. Two sets are compatible only when both state their inserted keys over the same columns and the filters provably don't intersect; anything unverifiable conflicts. Any data-changingAddFragmentcounts as inserting rows, which over-approximates: rows a merge insert updates also land in a new fragment.Declared reads:
AssertCellsUnchangednames the cells an operation read, and any concurrent write to them conflicts, a re-encode included. Without it, two updates that each set one column from the other's both commit, which no serial order produces.Row versions
RefreshRowVersionMetadatatakes aRowSelectionper fragment (whole fragment or an offsets bitmap) and sets those rows'last_updated_at_versionto the commit version. It's explicit because the rows a change restamps aren't implied by the file it writes:RewriteColumnsand merge_insert's partial-fragment path write a whole column file but restamp only matched rows. On a stable-row-id table, a data-changingAddDataFileon an existing fragment requires a refresh covering it.Fragment reuse history
AppendFragReuseTransitionrecords which rows compaction moved, andTrimFragReusedrops entries no index segment still needs. Both apply to the history as it stands at commit, so concurrent compactions don't conflict over it. The commit path loads an external history before building the manifest and spills one that outgrows the inline limit; cleanup collects row maps from failed compactions. Tagged histories on stable-row-id tables are debug-build-only for now (#10446).Rejected rather than tracked
These are refused rather than modeled, at the cost of a retry or an unsupported case:
data_change = false). Fragment reuse destinations must be added that way.Differences from legacy
Updatetranslates only in its vertical form.RewriteRowsandRewriteColumns, likeMergeandProject, depend on what the read version holds and are rejected, falling back to always-retry.UpdateMemWalStatedrops the read version's fragments from the manifest it builds; the action path keeps them. The parity test records both.🤖 Generated with Claude Code