Skip to content

docs: document the rules for transaction conflicts#6158

Merged
westonpace merged 2 commits intolance-format:mainfrom
westonpace:docs/transaction-conflict-rules
Mar 10, 2026
Merged

docs: document the rules for transaction conflicts#6158
westonpace merged 2 commits intolance-format:mainfrom
westonpace:docs/transaction-conflict-rules

Conversation

@westonpace
Copy link
Copy Markdown
Member

There was a conflict table in transaction.rs but this was incomplete (some rows/columns missing) and seemed to be imprecise or incorrect in a few spots. I've attempted to more thoroughly document this in transaction.md instead.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Mar 10, 2026
@github-actions
Copy link
Copy Markdown
Contributor

PR Review

This is a well-structured documentation improvement that replaces an incomplete conflict table in code comments with a thorough markdown specification. The directional framing (from the perspective of the operation being committed) is a good call and addresses a common source of confusion.

Two issues to flag:

1. Merge Compatibility lists Project as retryable, but code treats it as incompatible (P1)

In the "Merge Compatibility" section, Project is listed under "retryable conflicts". However, in conflict_resolver.rs:969, Project is in the incompatible_conflict_err branch alongside Overwrite, Restore, and UpdateMemWalState. Project should be moved to the "conflicts with" (non-retryable) list for Merge.

2. Unresolved TODO should not be merged (P0)

Under "CreateIndex Compatibility", there is:

- Merge ??? TODO - test this

This should be resolved before merging — either verify and document the behavior, or remove it with a tracking issue.

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Comment on lines +172 to +173
If two CreateIndex operations are committed concurrently then it is allowed. If the indexes have different names this is no
problem. If the indexes have the same name then the second operation will win and replace the first.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems accurate to the current implementation. Though I think we should probably change it so you can commit index segments for disjoint fragment sets and it be additive.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we are allowed multiple UUIDs per name that does make sense.

Comment thread docs/src/format/table/transaction.md Outdated

- Rewrite (only if overlapping fragments, no stable row ids, and no fragment reuse index)
- DataReplacement (only if overlapping fragments and the column being replaced is being indexed)
- Merge ??? TODO - test this
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have an answer for this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is not a conflict. I was originally thinking merge == update and I was confused how it couldn't be if the merge could replace a column. However, the logic in merge seems to assume we are only ever adding columns and so it considers it ok.

@westonpace westonpace merged commit 6be1b58 into lance-format:main Mar 10, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants