Skip to content

Auto conflict resolution for delete #3796

@wjones127

Description

@wjones127

We can optimally resolve conflicts between delete queries that affect different rows. We have the facility for this already tested for merge_insert and update. We want to do the same for updates.

In update queries, we do this by passing the row addresses that have been deleted (in Lance, updates are implemented as "delete + append") via the with_affected_rows method on CommitBuilder:

https://github.com/lancedb/lance/blob/0fad40d676b24d9355a6b2dbe626111684f1696a/rust/lance/src/dataset/write/update.rs#L397-L401

This is later handled in TransactionRebase under conflict_resolver.rs. Deletes look to already by handled here, so it's possible no additional changes are needed in that file.

TODO: (A TDD approach:)

  • Add a test to validate multiple deletes and updates affecting different rows can happen concurrently.
  • Write up the deleted rows to with_affected_rows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions