Skip to content

Commit

Permalink
Update routing for commands from server modules. (#2461)
Browse files Browse the repository at this point in the history
* Update routing for commands from server modules.

Signed-off-by: Yury-Fridlyand <[email protected]>
  • Loading branch information
Yury-Fridlyand authored Oct 15, 2024
1 parent 23a180b commit e51aa6d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
* Python: Add JSON.CLEAR command ([#2418](https://github.com/valkey-io/valkey-glide/pull/2418))
* Python: Add JSON.TYPE command ([#2409](https://github.com/valkey-io/valkey-glide/pull/2409))
* Python: Add JSON.NUMINCRBY command ([#2448](https://github.com/valkey-io/valkey-glide/pull/2448))


* Java: Added `FT.CREATE` ([#2414](https://github.com/valkey-io/valkey-glide/pull/2414))
* Core: Update routing for commands from server modules ([#2461](https://github.com/valkey-io/valkey-glide/pull/2461))

#### Breaking Changes

Expand Down
31 changes: 28 additions & 3 deletions glide-core/redis-rs/redis/src/cluster_routing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,14 @@ impl ResponsePolicy {
Some(ResponsePolicy::AllSucceeded)
}

b"KEYS" | b"MGET" | b"SLOWLOG GET" | b"PUBSUB CHANNELS" | b"PUBSUB SHARDCHANNELS" => {
Some(ResponsePolicy::CombineArrays)
}
b"KEYS"
| b"FT._ALIASLIST"
| b"FT._LIST"
| b"MGET"
| b"SLOWLOG GET"
| b"PUBSUB CHANNELS"
| b"PUBSUB SHARDCHANNELS" => Some(ResponsePolicy::CombineArrays),

b"PUBSUB NUMSUB" | b"PUBSUB SHARDNUMSUB" => Some(ResponsePolicy::CombineMaps),

b"FUNCTION KILL" | b"SCRIPT KILL" => Some(ResponsePolicy::OneSucceeded),
Expand Down Expand Up @@ -429,6 +434,8 @@ fn base_routing(cmd: &[u8]) -> RouteBy {
b"DBSIZE"
| b"FLUSHALL"
| b"FLUSHDB"
| b"FT._ALIASLIST"
| b"FT._LIST"
| b"FUNCTION DELETE"
| b"FUNCTION FLUSH"
| b"FUNCTION LOAD"
Expand Down Expand Up @@ -689,6 +696,14 @@ pub fn is_readonly_cmd(cmd: &[u8]) -> bool {
| b"EXISTS"
| b"EXPIRETIME"
| b"FCALL_RO"
| b"FT.AGGREGATE"
| b"FT.EXPLAIN"
| b"FT.EXPLAINCLI"
| b"FT.INFO"
| b"FT.PROFILE"
| b"FT.SEARCH"
| b"FT._ALIASLIST"
| b"FT._LIST"
| b"FUNCTION DUMP"
| b"FUNCTION KILL"
| b"FUNCTION LIST"
Expand All @@ -712,6 +727,16 @@ pub fn is_readonly_cmd(cmd: &[u8]) -> bool {
| b"HSCAN"
| b"HSTRLEN"
| b"HVALS"
| b"JSON.ARRINDEX"
| b"JSON.ARRLEN"
| b"JSON.DEBUG"
| b"JSON.GET"
| b"JSON.OBJLEN"
| b"JSON.OBJKEYS"
| b"JSON.MGET"
| b"JSON.RESP"
| b"JSON.STRLEN"
| b"JSON.TYPE"
| b"KEYS"
| b"LCS"
| b"LINDEX"
Expand Down

0 comments on commit e51aa6d

Please sign in to comment.