-
Notifications
You must be signed in to change notification settings - Fork 15
Description
This is a critical issue and leads to duplication of data in cluster as described in https://jira.vk.team/browse/TNTP-2109. It may also break vshard. Crud makes call, using replicaset
object, which is low-level API:
Lines 102 to 105 in 419296e
local storage_result, err = call.single(vshard_router, | |
sharding_data.bucket_id, CRUD_REPLACE_FUNC_NAME, | |
{space_name, tuple, replace_on_storage_opts}, | |
call_opts |
CRUD_REPLACE_FUNC_NAME
is crud.replace_on_storage
. It's called in retry_call_with_master_discovery
:
Line 90 in 419296e
return replicaset[method](replicaset, ...) |
So, at the end we have, that replace_on_storage
is explicitly called. However, you CANNOT rely on routeall
and route
functions in vshard, they return cache value of the router, which may outdated. In order to figure out, whether the bucket is on the instance, explicit call must be done.
The example is about replace
explicitly, however, In the scope of this issue, all requests must be checked. They should not use replicaset:call
as it's now, vshard.router.call
is more preferable. If replicaset:call
should be preserved, then it must call vshard.storage.call
with {bucket_id, mode, func, args}
argument (see, how vshard.router.call
is implemented: link