tarantool / tarantool/doc

vshard: `bucket_ids` in `map_callrw` can now be map, instead of array

Open
#5,170 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

bucket_ids option for map_callrw can now be either map: {[<bucket_id>] =
{ }, ...}, or array: {<bucket_id>, ...}. In the latter case
the map_callrw is an ordinary partial map callrw request, as it works
now.

If bucket_ids is the map, then it's partial map callrw request and
arguments are split. It works as follows:

map_callrw('func', {'abc', 'def'}, {bucket_ids = {
    [1] = {'bucket 1 arg'},
    [2] = {'bucket 2 arg'},
    [3] = {'bucket 3 arg'},
}})

Consider master of some replicaset has only bucket 2 and 3. Then the
following function will be called there:

func('abc', 'def', {[2] = {'bucket 2 arg'}, [3] = {'bucket 3 arg'}})

So, all data, passed as a second argument of map_callrw (old args) is
shared between all masters, data from the bucket_ids is split and
sent only to the instance, where it belongs.

Note, that if args is nil:

map_callrw('func', nil, {bucket_ids = {
    [1] = {'bucket 1 arg'},
    [2] = {'bucket 2 arg'},
    [3] = {'bucket 3 arg'},
}})

Then the user function gets only split data:

func({[2] = {'bucket 2 arg'}, [3] = {'bucket 3 arg'}})

Requested by @Serpentian in https://github.com/tarantool/vshard/commit/f15ccab1f75f78e9cd8d7492278341ce320e8644.

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

Start by locating the vshard documentation for the map_callrw entry point and compare it with the behavior described here. Update the documentation to cover array and map bucket_ids, argument splitting, and the nil-args case, with examples matching the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.