tarantool / tarantool/crud

Be careful with bucket pinning

Open
#59 2 comments 0 reactions 0 assignees View on GitHub

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

  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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.