valkey-io/valkey

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

オープン

#560 opened on 2024/05/27

 (5 件のコメント) (0 件のリアクション) (1 人の担当者)C (1,138 件のフォーク)batch import
breaking-changebughelp wanted

Repository metrics

Stars
 (25,779 個のスター)
PR merge metrics
 (平均マージ 17d 7h) (30d で 74 merged PRs)

説明

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.

コントリビューターガイド