diff --git a/redis/src/cluster_routing.rs b/redis/src/cluster_routing.rs index a37b875be..5fe471682 100644 --- a/redis/src/cluster_routing.rs +++ b/redis/src/cluster_routing.rs @@ -418,17 +418,18 @@ fn base_routing(cmd: &[u8]) -> RouteBy { | b"PUBSUB CHANNELS" | b"PUBSUB NUMSUB" | b"PUBSUB SHARDCHANNELS" - | b"PUBSUB SHARDNUMSUB" => RouteBy::AllNodes, + | b"PUBSUB SHARDNUMSUB" + | b"SCRIPT KILL" + | b"FUNCTION KILL" + | b"FUNCTION STATS" => RouteBy::AllNodes, b"DBSIZE" | b"FLUSHALL" | b"FLUSHDB" | b"FUNCTION DELETE" | b"FUNCTION FLUSH" - | b"FUNCTION KILL" | b"FUNCTION LOAD" | b"FUNCTION RESTORE" - | b"FUNCTION STATS" | b"INFO" | b"KEYS" | b"MEMORY DOCTOR" @@ -437,7 +438,6 @@ fn base_routing(cmd: &[u8]) -> RouteBy { | b"MEMORY STATS" | b"PING" | b"SCRIPT EXISTS" - | b"SCRIPT KILL" | b"UNWATCH" | b"WAIT" | b"RANDOMKEY" @@ -1042,7 +1042,7 @@ mod tests { assert_eq!( RoutingInfo::for_routable(&cmd("SCRIPT KILL")), Some(RoutingInfo::MultiNode(( - MultipleNodeRoutingInfo::AllMasters, + MultipleNodeRoutingInfo::AllNodes, Some(ResponsePolicy::OneSucceeded) ))) ); diff --git a/redis/tests/test_cluster_async.rs b/redis/tests/test_cluster_async.rs index 1c995e343..4dbc0653b 100644 --- a/redis/tests/test_cluster_async.rs +++ b/redis/tests/test_cluster_async.rs @@ -1979,15 +1979,12 @@ mod cluster_async { respond_startup_with_replica_using_config(name, received_cmd, None)?; if port == 6381 { return Err(Ok(Value::Okay)); - } else if port == 6379 { - return Err(Err(( - ErrorKind::NotBusy, - "No scripts in execution right now", - ) - .into())); } - - panic!("unexpected port {port}"); + Err(Err(( + ErrorKind::NotBusy, + "No scripts in execution right now", + ) + .into())) }, );