Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change SCRIPT KILL, FUNCTION KILL, FUNCTION STATS routing #181

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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