-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Feature request: handle cross-slot multikey queries when all the keys are on the same node #6794
Comments
Blocking XREAD with multiple keys is indeed a good use case. One situation where you know your keys belong to the same node is when you got the keys using SCAN on some node. But there may be other smart ways of knowing this. Although we want to encourage a separation between client lib (mapping key to slot and node) and end user (only care about
I like this idea. Maybe |
@madolson Can we expect this feature in future Redis releases. As we know that Design: To execute n key multi-key command, client groups this into K commands with hash ranges owned by each shards. (K is number of shards in cluster) Since In above multiple nodes are involved to execute multi-key command, so their execution is not guaranteed to be atomic (so, they can actually break the atomic design of many Redis commands). For that we can add a new config in |
@singh-bhawani No, because Redis decided to change the license on us. https://redis.com/blog/redis-adopts-dual-source-available-licensing/ . If you're still interested in this feature, please request it here. https://github.com/placeholderkv/placeholderkv/issues |
My team is building a service. Each client of the service is reading from its own Redis stream. Each stream gets new entries appended after a random delay of 1sec-1min. We want clients to get the new data as soon as possible, and we want to serve about 100k-1M clients at the same time.
It's awesome that
XREAD
can read from multiple streams, this can greatly improve resource utilization: less empty reads, connections blocked for less time. Unfortunately this doesn't quite work in Redis Cluster due to the requirement that all the keys must hash to the same slot.With our target numbers I'm not sure we can afford not to read multiple streams with single connection. We are currently considering the following hack, where we would call a lua script passing multiple stream keys (that we know are currently on the same node) as arguments:
however, the script has quite a bit of overhead compared to
XREAD
...I know Redis Cluster multikey issue has been discussed multiple times before (e.g. #5061, #5118):
but how about adding an option to disable this check for clients that understand the risk?
Maybe a new config option
enable-local-cross-slot
(similar toenable-cross-slot
option in Redis Cluster Proxy project)?The text was updated successfully, but these errors were encountered: