mirror of
https://github.com/redis/redis.git
synced 2026-02-03 20:39:54 -05:00
Merge e35bc21637 into b5a37c0e42
This commit is contained in:
commit
4fff92f7d8
2 changed files with 11 additions and 2 deletions
|
|
@ -1245,8 +1245,9 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in
|
|||
margv = pcmd->argv;
|
||||
|
||||
/* Only valid for sharded pubsub as regular pubsub can operate on any node and bypasses this layer. */
|
||||
if (!pubsubshard_included &&
|
||||
doesCommandHaveChannelsWithFlags(mcmd, CMD_CHANNEL_PUBLISH | CMD_CHANNEL_SUBSCRIBE))
|
||||
if (!pubsubshard_included && (mcmd->proc == ssubscribeCommand ||
|
||||
mcmd->proc == sunsubscribeCommand ||
|
||||
mcmd->proc == spublishCommand))
|
||||
{
|
||||
pubsubshard_included = 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,4 +64,12 @@ start_cluster 1 1 {tags {external:skip cluster}} {
|
|||
catch {[$replica EXEC]} err
|
||||
assert_match {EXECABORT*} $err
|
||||
}
|
||||
|
||||
test "Sharded pubsub sunsubscribe behavior on replica" {
|
||||
$replica SUNSUBSCRIBE foo
|
||||
|
||||
$replica MULTI
|
||||
$replica SUNSUBSCRIBE foo
|
||||
$replica EXEC
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue