Skip to content

Commit 0f8fc57

Browse files
router: add box tuple case for shard key hashing
In scope of tarantool/tarantool#8147, box tuples returned from remote procedure calls our now encoded as a new extension, `MP_TUPLE`, and, consequently, the results of such calls are now decoded as box tuples. For compatibility with this feature, we need to add this case to shard key hashing. Since box tuples are semantically equivalent to Lua tables, we can process them the same way. Needed for tarantool/tarantool#8147 NO_DOC=<refactoring> NO_TEST=<refactoring>
1 parent b3c27b3 commit 0f8fc57

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vshard/hash.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ end
3939
-- double.
4040
--
4141
local function mpcrc32(shard_key)
42-
if type(shard_key) ~= 'table' then
42+
if type(shard_key) ~= 'table' and not box.tuple.is(shard_key) then
4343
return ldigest.crc32(mpcrc32_one(shard_key))
4444
else
4545
local crc32 = ldigest.crc32.new()

0 commit comments

Comments
 (0)