-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Pipelined usage of Redis Cluster with Lettuce fails for some commands that return PipelinedRedisFuture
#2888
Comments
Thanks for the report. We actually never intended to support Cluster via pipelining due to the fact that Cluster consists of multiple connections and we would kind-of create a asynchronous command queue that is distributed across nodes. The Jedis implementation doesn't consider cluster pipelining at all. Some Lettuce commands are implemented in a synchronous way (e.g. However, it makes sense to allow commands that Lettuce returns as |
PipelinedRedisFuture
Could you please clarify how I can use pipelining considering that we have Redis in cluster mode, and we're using spring-data-redis with lettuce? What would be the best practice? Currently, I just replaced mset with setex, and everything started working fine. |
We intend to refine what we support and what is out of support. Cluster was never built with pipelining in mind, also transactions are not supported. Back in the day when Redis Cluster was implemented, Jedis didn't support pipelining at all. Pipelining with Lettuce works by coincidence as Lettuce has no specific pipelining API, we leverage pipelining by using its async API. You can find a branch holding some changes around support and documentation at #2889. Going forward, we could revisit our Jedis arrangement and investigate how to enable pipelining for commands that do not require cross-slot-specific handling. |
Hello!
I encountered an issue while using RedisTemplate.executePipelined with Redis Cluster. I'm attaching a Minimal Reproducible Example (MRE) for your reference. This issue occurs both in a locally deployed cluster and in a cluster deployed in a test environment.
The problem arises when calling mSet with keys that map to different nodes. The data itself gets written to Redis, but then an error is thrown. It seems that the cause is here. In this case, resultHolder is a PipelinedRedisFuture, which cannot be cast to RedisCommand.
It reproduces since 2.7.11
Here's the stack trace.
The text was updated successfully, but these errors were encountered: