lance-format / lance-format/lance
Refactor index operations to be fully transactional
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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