Skip to content

Commit

Permalink
Change SCRIPT KILL, FUNCTION KILL, FUNCTION STATS routing (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamazon authored Aug 8, 2024
1 parent 374c7bb commit b43a07e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
10 changes: 5 additions & 5 deletions redis/src/cluster_routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -1042,7 +1042,7 @@ mod tests {
assert_eq!(
RoutingInfo::for_routable(&cmd("SCRIPT KILL")),
Some(RoutingInfo::MultiNode((
MultipleNodeRoutingInfo::AllMasters,
MultipleNodeRoutingInfo::AllNodes,
Some(ResponsePolicy::OneSucceeded)
)))
);
Expand Down
13 changes: 5 additions & 8 deletions redis/tests/test_cluster_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
},
);

Expand Down

0 comments on commit b43a07e

Please sign in to comment.