tarantool / vshard

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

Use `msgpack_iterator:take_array()` method #324

Closed Gerold103 closed 2 years ago

Gerold103 commented 2 years ago

The patchset makes the router use take_array() method of msgpack iterator instead of manual tail cut via an intermediate Lua table.

olegrok commented 2 years ago

LGTM However it breaks all version checks introduced previously. There is a "gap" between commits where msgpack object was introduced and is_array method was implemented. But I believe that there should be nothing serious.

I meant that to be consistent both of this conditions should be replaced with msgpack.object ~= nil and msgpack.object({}).take_array ~= nil. https://github.com/tarantool/vshard/blob/cd321dd4b97952c35cad698c474a41eea5bbc35c/vshard/util.lua#L238-L240

Gerold103 commented 2 years ago

In the commit message I added specifically that distinguishing these cases wouldn't make much sense. Neither msgpack object, nor its iterator, nor take_array method are released.