tarantool / vshard

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

Router `is_async` is broken on the latest tarantool #294

Closed Gerold103 closed 2 years ago

Gerold103 commented 2 years ago

After netbox was reworked, vshard router's future:wait_result() got broken. This is because the router tried to replace the result method of future with a wrapper, which would remove the service values internal to the router.

It seems the new netbox future objects do not check their __index for methods, so the methods can't be overridden.

This is my fault, because I relied on a non-documented feature of being able to add stuff to the future object. A fix would be to wrap netbox futures with a Lua table in vshard, which would have special methods. At least the ones which return the request result.

It seems to be affecting only router's public API. Internal code like discovery used raw netbox futures and does not look broken. At least the tests pass. The now broken tests are router/router.test.lua and failover/failover.test.lua.