redis / redis-rb

A Ruby client library for Redis
MIT License
3.97k stars 1.03k forks source link

Cluster Mode: Transactions (multi) #1224

Closed nicdal closed 1 year ago

nicdal commented 1 year ago

Hi 👋 ,

After 5.0.0 it's not possible to use the multi call due to the error message: Redis::Cluster::AmbiguousNodeError: Cluster client doesn't know which node the multi command should be sent to.

What is the recommended solution for transactions in cluster mode?

One example of how we use transactions.

MULTI
DEL key
PFADD key 1
EXPIRE key 60
EXEC
supercaracal commented 1 year ago

Unfortunately, current client doesn't implement transaction method. It may be able to make it by lua scripts.

https://redis.io/docs/interact/transactions/#redis-scripting-and-transactions