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

v1.6.0 no longer works with Redis cluster #131

Closed
pbstriker38 opened this issue Oct 31, 2023 · 3 comments
Closed

v1.6.0 no longer works with Redis cluster #131

pbstriker38 opened this issue Oct 31, 2023 · 3 comments

Comments

@pbstriker38
Copy link
Contributor

Attempting to use defaults raises an error because the unwatch command is not supported on Redis clusters.

Loading development environment (Rails 7.0.8)
irb(main):001> last_seen_at = Kredis.datetime('last_seen_at', default: 20.minutes.ago, expires_in: 1.week)
[2023-10-31T16:28:21.283-07:00] INFO:   Kredis  (43.7ms)  Connected to shared
[2023-10-31T16:28:21.289-07:00] DEBUG:   Kredis Proxy (1.6ms)  EXISTS? last_seen_at  
[2023-10-31T16:28:21.291-07:00] DEBUG:   Kredis Proxy (1.6ms)  SET last_seen_at ["2023-10-31T23:08:21.239912000Z"] {:ex=>1 week}
/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/redis-4.8.1/lib/redis/cluster.rb:152:in `send_command': Cluster client doesn't know which node the unwatch command should be sent to. (Redis::Cluster::AmbiguousNodeError)
/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/redis-4.8.1/lib/redis/cluster.rb:152:in `send_command': Cluster client doesn't know which node the unwatch command should be sent to. (Redis::Cluster::AmbiguousNodeError)

https://github.com/redis/redis-rb/blob/v4.8.1/lib/redis/cluster.rb#L151

@dhh
Copy link
Member

dhh commented Dec 29, 2023

cc @lewispb

@lewispb
Copy link
Contributor

lewispb commented Dec 30, 2023

I just ran the test suite against Redis Cluster locally and most of it failed. Looks like we don't support Redis Cluster.

It's not just unwatch that's unsupported, multi and mget are too, both of which are used by Kredis.

We could add a note to the Readme perhaps? #137

@KJTsanaktsidis
Copy link

It's not just unwatch that's unsupported, multi and mget are too, both of which are used by Kredis.

FWIW I'm in the process of trying to get as much of watch/multi as makes sense working with the Ruby redis cluster driver: redis-rb/redis-cluster-client#299

Once we get that support landed, making kredis work with redis-cluster should be a case of figuring out which keys need to be accessed transactionally together, and adding {hashtags} to them so that they hash to the same slot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants