mirror of https://mirror.osredm.com/root/redis.git
SUNSUBSCRIBE on replica should not return MOVED to master
This commit is contained in:
parent
9906daf5c9
commit
e35bc21637
|
@ -1131,8 +1131,9 @@ clusterNode *getNodeByQuery(client *c, struct redisCommand *cmd, robj **argv, in
|
|||
margv = ms->commands[i].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;
|
||||
}
|
||||
|
|
|
@ -63,4 +63,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 New Issue