You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch introduces a new way of `map_callrw` execution by which we can
pass some arguments to all storages and split buckets' arguments to those
storages that have at least one bucket of `bucket_ids`. To achieve this we
introduce a new string option - `mode` to `map_callrw` api.
Also we change the logic of `router_ref_storage_all` ref function. Firstly
we ref all storages and get back an amount of "moved" buckets according
to the previously built router's cache. Then if there are no "moved"
buckets we accumulate and check total amount of buckets on all storages
and finish map_callrw ref stage. Otherwise, if there are some "moved"
buckets we perform the second network hop by checking on which replicasets
do the remaining "moved" buckets reside on.
Closes#559@TarantoolBot document
Title: vshard: `mode` option for `router.map_callrw()`
This string option regulates on which storages the user function will be
executed via `map_callrw`. Possible values:
1) mode = 'partial'. In this mode user function will be executed on
storages that have at least one bucket of 'bucket_ids'. The
'bucket_ids' option can be presented in two ways: like a numeric array
of buckets' ids or like a map of buckets' arguments. In first one user
function will only receive args, in second one it will additionally
receive buckets' arguments.
2) mode = 'full'. In this mode user function will be executed with args on
all storages in cluster. If we pass 'bucket_ids' like a map of bucket's
arguments the user function will additionally receive buckets'
arguments on those storages that have at least one bucket of
'bucket_ids'.
If we didn't specify the 'mode' option, then it is set based on
'bucket_ids' option - if 'bucket_ids' is presented, the mode will be
'partial' otherwise 'full'. Also now `map_callrw` ends with error in
cases of `<mode = 'full', bucket_ids = {1, 2, ...}>` and `<mode =
'partial', bucket_ids = nil>`.
0 commit comments