Be careful with bucket pinning
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 43
- Forks
- 17
- Avg merge
- 28m
- Merged PRs (30d)
- 2
Description
This is from @Gerold103 feedback.
Be careful when splitting vshard operations in 2: getting a replicaset and sending operation to the replicaset.
Inside, vshard performs bucket pinning to make sure that the bucket doesn't migrate anywhere while the operation is being processed. When you split the operation into 2 stages, it is possible that the bucket will migrate between them.
Let me demonstrate the problem in the current codebase: https://github.com/tarantool/crud/blob/a838f5850aa17c8ad768d36edf86f2a7f3e41a1a/crud/update.lua#L78-L86
In this case, you probably should just do vshard.callrw().
Contributor guide
No contributing guide indexed for this repository
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
Start with crud/update.lua around lines 78-86 and read the linked vshard operation flow. Check how bucket pinning behaves when locating a replicaset and sending the operation as separate stages, then compare the suggested vshard.callrw() path. Done means the update operation cannot race with bucket migration between those stages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- backend, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100