valkey-io/valkey

[BUG] PUBSUB SHARDNUMSUB doesn't return -CROSSSLOT for cross slot shard-channels

開放

#560 建立於 2024年5月27日

 (5 則留言) (0 個反應) (1 位負責人)C (1,138 個分叉)batch import
breaking-changebughelp wanted

倉庫指標

星標
 (25,779 顆星)
PR 合併指標
 (平均合併 17天 7小時) (30 天內合併 74 個 PR)

描述

Describe the bug

In cluster mode, calling this command with two channels mapping to different slots, like PUBSUB SHARDNUMSUB ch1 ch2, succeeds. It should return a -CROSSSLOT error, like any command with keys of two different slots.

To reproduce

Call the command with two channels mapping to the same node, but different cluster slots.

Expected behavior

-CROSSSLOT error reply.

Additional information

I believe it's enough to add a key specification in the command's JSON file under src/commands/. That would make the generic machinery for cluster crosslot detect the error early and return an error.

貢獻者指南