tarantool / vshard

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

Support 'raw args' feature from the latest Tarantool to avoid args decoding on router #312

Closed Gerold103 closed 2 years ago

Gerold103 commented 2 years ago

The newest Tarantool version has a new function setting takes_raw_args. Instance can create such function in _func and it will take arguments as a raw MessagePack buffer. The function then can decode some first arguments and leave the others not decoded. For instance, to forward them further to another instance.

Also netbox now supports return_raw option - works the same. Result of the remote call is a raw MessagePack buffer. Not decoded into Lua values.

These options together should help to reduce pressure on the router when it is used as a proxy. Router would need to offer a function like vshard.router.callraw(). It would take a MessagePack buffer with the same arguments encoded as vshard.router.call() and return result also as a MessagePack buffer (using return_raw netbox option when talks to the storage).

In order to use it the user would need to register it in _func with takes_raw_args and call it from clients. Router can't do that itself, because it is not supposed to depend on any local spaces.