Repository navigation
Conversation
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.
8744d61 to
322132a
Compare
322132a to
8470273
Compare
8470273 to
61ffa2d
Compare
…tion set conflicts Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion set conflicts Conflict errors for action sets now name the user step, the concurrent commit by operation or step, and what collided in terms of fields and fragments, instead of footprint parts or action names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et a named operation lost to Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…et a named operation lost to Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
61ffa2d to
263e885
Compare
There was a problem hiding this comment.
✅ Gate recommendation: approve.
Conflict detection and replay validation retain their existing behavior, with diagnostics derived from in-memory step attribution.
Please mark this PR with the breaking-change label: lance_table::transaction::action::Verdict::Conflict now carries Conflict instead of String, and lance_table::transaction::action::ApplyError::Rejected is now a struct variant with error and step fields, so Rust callers constructing or matching these variants must update their code.
geruh
left a comment
There was a problem hiding this comment.
I like this direction, I pulled this down and ran some more combinations of transactions. But I think we're trying to infer a bit too much from the footprint though. For example, this is what I got with a column rewrite at v2 followed by a delete at v3:
Step "delete rows" conflicts with a concurrent step "rewrite col x" (version 2): rows were removed from fragment 0.
can we just do something like this instead?
Cannot commit "delete rows": the deletion file for fragment 0 changed between versions 1 and 3. [optionally can add a retry operation for a call to action if possible]
We can still include the commit and step when we actually know them. Otherwise just report what changed and the version range. I think this would simplify some of the logic without needing any additional state or IO. wdyt?
|
|
||
| /// A committed transaction a conflict is attributed to. | ||
| #[derive(Debug, Clone, Copy, PartialEq, Eq)] | ||
| pub struct Attribution { |
There was a problem hiding this comment.
nit: what do you think about ConflictSource or something close to that I think this pairs with the ConflictCause logic
| for (forbid, step) in &self.forbids { | ||
| if cause.is_some() && steps.contains(step) { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
What if our steps conflict with different commits? I tried this with config keys being changed in separate commits and the error reports both steps as conflicting w/ the commit that changed the first key
| fn attribute(&self, part: &Part) -> Option<Attribution> { | ||
| let touching = |touches: &dyn Fn(&Part) -> bool| { | ||
| self.committed | ||
| .iter() |
There was a problem hiding this comment.
I tried this locally with a rewrite followed by a delete, and the error ended up calling out the rewrite for removing the rows. hit the same thing with an exact fragment exists match too. Since touching a part doesn't mean a commit actually changed it, would it be safer to just fall back to the version range when we aren't sure which commit did it?
| /// exactly as it read it. | ||
| pub(super) fn touch(&mut self, part: Part) { | ||
| self.parts.insert(part); | ||
| self.parts.entry(part).or_insert(self.step); |
There was a problem hiding this comment.
Don't we lose the other steps that depend on this part?
| Operation::CompositeOperation(operation) => { | ||
| let steps = match step { | ||
| Some(step) => Steps::named(operation, &[step], 0), | ||
| None => Steps::named(operation, &[], 0), |
There was a problem hiding this comment.
If we don't know which step conflicted why are we listing the first few? The same behavior is in replay_conflict_message
Summary
Action-set commit conflicts reach end users, who should not need to know about actions. Today the message is a footprint part's
Debugoutput or the internals of the replay. This PR changes both messages to name the user's step (UserStep::description), the concurrent commit, and what collided.How it works:
Verdict::Conflictnow holds a structuredConflict: our step indices, the cause (aPartor aCollision), and anAttributionto the committed transaction and, when known, its step. The attribution is found by scanning the committed footprints the window already holds.ApplyError::Rejectednow carries the index of the step being applied. The replay names that step and lists the commits since the read version.conflict_resolver::message) produces the wording.Partis exported fromtransaction::actionagain, since the wording names each kind of part.Decisions:
UserStep::descriptionsays it is shown to end users.RetryableCommitConflictonly. There is no typed source and no newlance_core::Errorvariant. Conflicts between two named operations keep their old messages.Evidence
Before (output of the new tests on the base branch):
Before, for a named operation losing to an action set:
After:
Merge Risk
Door: Two-way. Only error text and in-memory types change, and the Transaction V2 API is experimental.
Blast Radius: The text of conflict errors when an action set is involved. Which commits conflict does not change.
🤖 Generated with Claude Code