valkey-io/valkey

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

Ouverte

#560 ouverte le 27 mai 2024

 (5 commentaires) (0 réaction) (1 personne assignée)C (1 138 forks)batch import
breaking-changebughelp wanted

Métriques du dépôt

Stars
 (25 779 étoiles)
Métriques de merge PR
 (Merge moyen 17j 7h) (74 PRs mergées en 30 j)

Description

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.

Guide contributeur