valkey-io/valkey

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

Offen

#560 geöffnet am 27.05.2024

 (5 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C (1.138 Forks)batch import
breaking-changebughelp wanted

Repository-Metriken

Stars
 (25.779 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 17T 7h) (74 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide