tarantool / vshard

The new generation of sharding based on virtual buckets
Other
100 stars 30 forks source link

`vshard.storage.callraw` for raw `msgpack.object` args on the storage #319

Open Gerold103 opened 2 years ago

Gerold103 commented 2 years ago

It was requested to support takes_raw_args option on the storage. It would require to introduce a new function vshard.storage.callraw which would take msgpack.object value instead of normal arguments. Router needs to call it when vshard.router.call gets a special option like pass_raw (symmetric to return_raw).

The motivation is not to unpack values which are going to be passed into box API anyway (space:replace, for instance).

Serpentian commented 2 days ago

@Gerold103 do we need pass_raw here? It looks like if vshard sees the first argument as msgpack, then vshard.router.call was registered with takes_raw_args and vshard has to manually unpack needed values of msgpack (everything except func and args) and then forward everything to vshard.storage.callraw. No need to introduce new opt.

Moreover, if opt will be introduced, then users will have to write wrappers for router calls, which unpack some values of function and pass it to vshard.router.call*. This is caused by the fact, that if function is registered as takes_raw_args, then all arguments are just one msgpack