Redis cluster mode pipeline operation

867 views
Skip to first unread message

Shushant Arora

unread,
Dec 19, 2017, 9:45:58 AM12/19/17
to Redis DB
Hi

Does redis support pipeline in cluster mode.
I am using Jedis client and getting Moved exception, How does jedis client handle exact node of a key in cluster mode of pipeline, Does jedis client send all keys to one node and that node then distribute keys in cluster to appropriate node ?


hva...@gmail.com

unread,
Dec 19, 2017, 10:13:04 AM12/19/17
to Redis DB
Redis cluster nodes do not proxy commands to other nodes.  See the 6th paragraph of https://redis.io/topics/cluster-spec where it says:

Since cluster nodes are not able to proxy requests, clients may be redirected to other nodes using redirection errors -MOVED and -ASK.

In Redis Cluster, each master node and slave node only holds some of the keys.  If you send write/read commands for keys that belong to the node, you get answers because the node has the keys.  If you send write/read commands for keys that belong in other nodes, you get a Moved or Ask error, telling you the node does not have the key.

Command pipelining doesn't matter.  Pipelining is nothing more than whether you wait for a command's response before sending the next command (non-pipelined), or don't wait for the response (pipelined).  If you send a command for a key to a Redis Cluster node that doesn't have the key, you will get the Moved or Ask error for that command.

Shushant Arora

unread,
Dec 19, 2017, 1:13:19 PM12/19/17
to redi...@googlegroups.com
Ok..
If I use Redisson library does it provide cluster mode natively.

Can I set Hash key with specific fields in Redisson batch mode in cluster mode?
basically alternative of pipeline.hmget("key", fields);

RBatch rbatch = redisson.createBatch();
 rbatch.getMap(name, //how to get specific fields ??

--
You received this message because you are subscribed to a topic in the Google Groups "Redis DB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/redis-db/oulYhqbnOQ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to redis-db+unsubscribe@googlegroups.com.
To post to this group, send email to redi...@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages