lance-format / lance-format/lance

Refactor index operations to be fully transactional

Open
#3,994 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

chore
Dominant language
Rust
Stars
7.1k
Forks
852
Avg merge
3d 18h
Merged PRs (30d)
272

Description

Currently, if there are multiple indexes of the same name, we handle index deduplication at https://github.com/lancedb/lance/blob/2280e0fbf9cf83a717dea08a97eb9ab62a6a07c9/rust/lance/src/dataset/transaction.rs#L1488-L1495.

This works for now because index creation and reindexing (CreateIndex(replace=true)) is typically done through a single recurring process. However, if we want to be strict, this would break if there are 2 concurrent reindex process that both modifies the same index. In that case, the second process will clobber the result of the first one, whereas the right behavior should be that the second one fail because of modifying the same index.

The right way is probably to pass the replaced index to the transaction operation at https://github.com/lancedb/lance/blob/main/rust/lance/src/index.rs#L415, and then update the conflict_resolver to properly resolve such conflict.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read rust/lance/src/dataset/transaction.rs around the index deduplication logic and rust/lance/src/index.rs around line 415. Trace how the replaced index reaches the transaction operation and how conflict_resolver handles it; done means concurrent reindex operations on the same index conflict instead of one clobbering the other.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
databases
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.