Skip to content

Commit b43a07e

Browse files
authored
Change SCRIPT KILL, FUNCTION KILL, FUNCTION STATS routing (#181)
1 parent 374c7bb commit b43a07e

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

redis/src/cluster_routing.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,17 +418,18 @@ fn base_routing(cmd: &[u8]) -> RouteBy {
418418
| b"PUBSUB CHANNELS"
419419
| b"PUBSUB NUMSUB"
420420
| b"PUBSUB SHARDCHANNELS"
421-
| b"PUBSUB SHARDNUMSUB" => RouteBy::AllNodes,
421+
| b"PUBSUB SHARDNUMSUB"
422+
| b"SCRIPT KILL"
423+
| b"FUNCTION KILL"
424+
| b"FUNCTION STATS" => RouteBy::AllNodes,
422425

423426
b"DBSIZE"
424427
| b"FLUSHALL"
425428
| b"FLUSHDB"
426429
| b"FUNCTION DELETE"
427430
| b"FUNCTION FLUSH"
428-
| b"FUNCTION KILL"
429431
| b"FUNCTION LOAD"
430432
| b"FUNCTION RESTORE"
431-
| b"FUNCTION STATS"
432433
| b"INFO"
433434
| b"KEYS"
434435
| b"MEMORY DOCTOR"
@@ -437,7 +438,6 @@ fn base_routing(cmd: &[u8]) -> RouteBy {
437438
| b"MEMORY STATS"
438439
| b"PING"
439440
| b"SCRIPT EXISTS"
440-
| b"SCRIPT KILL"
441441
| b"UNWATCH"
442442
| b"WAIT"
443443
| b"RANDOMKEY"
@@ -1042,7 +1042,7 @@ mod tests {
10421042
assert_eq!(
10431043
RoutingInfo::for_routable(&cmd("SCRIPT KILL")),
10441044
Some(RoutingInfo::MultiNode((
1045-
MultipleNodeRoutingInfo::AllMasters,
1045+
MultipleNodeRoutingInfo::AllNodes,
10461046
Some(ResponsePolicy::OneSucceeded)
10471047
)))
10481048
);

redis/tests/test_cluster_async.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,15 +1979,12 @@ mod cluster_async {
19791979
respond_startup_with_replica_using_config(name, received_cmd, None)?;
19801980
if port == 6381 {
19811981
return Err(Ok(Value::Okay));
1982-
} else if port == 6379 {
1983-
return Err(Err((
1984-
ErrorKind::NotBusy,
1985-
"No scripts in execution right now",
1986-
)
1987-
.into()));
19881982
}
1989-
1990-
panic!("unexpected port {port}");
1983+
Err(Err((
1984+
ErrorKind::NotBusy,
1985+
"No scripts in execution right now",
1986+
)
1987+
.into()))
19911988
},
19921989
);
19931990

0 commit comments

Comments
 (0)