jedis icon indicating copy to clipboard operation
jedis copied to clipboard

Cluster pipelining

Open sdncha opened this issue 7 years ago • 16 comments

Added pipelining support to JedisCluster, making least changes on other classes. The idea is capturing all commands sent with pipeline, and replaying them for cluster redirecting.

sdncha avatar Jan 02 '17 07:01 sdncha

@sdncha thx for the contribution!. This PR looks promising and hopefully we can merge soon. It'll probably take me some time but I definitely would like to include it. @HeartSaVioR if you have some time I'd like your help to review.

marcosnils avatar Jan 02 '17 17:01 marcosnils

@marcosnils , glad to hear that. I look forward to your reviews and would like to improve it, make it good enough to be merged.

sdncha avatar Jan 02 '17 22:01 sdncha

@sdncha Thanks for the contribution. Could you refer the latest comments on #1527 to see my theory on this side, and put your theory? Please note that only idempotent operations could be placed to replay.

HeartSaVioR avatar Jul 03 '17 13:07 HeartSaVioR

You may want to revisit the discussion prior to put your theory: https://groups.google.com/d/msg/redis-db/4I0ELYnf3bk/Lrctk0ULm6AJ

HeartSaVioR avatar Jul 03 '17 13:07 HeartSaVioR

I was wondering what the status of this PR is. Is anyone still looking at it?

ChetanBhasin avatar Jun 20 '18 07:06 ChetanBhasin

Any updates on this?

rkass avatar Oct 23 '18 20:10 rkass

+1 for support for pipelining on a cluster. Would like to continue using Jedis libraries to talk to Elasticache without having to rewrite a bunch of existing code since pipelining is not supported. Pipelining is apparently is supported by the lettuce.io library, but rewriting everything is even less appealing.

ucjonathan avatar Oct 28 '18 12:10 ucjonathan

This would be a real nice feature.

mpermar avatar Nov 09 '18 17:11 mpermar

@marcosnils @sdncha @HeartSaVioR Any further discussion on this given the latest comments on https://github.com/xetorthio/jedis/issues/1527?

saberem avatar Jan 24 '19 22:01 saberem

Hi @sdncha,

when we had a network issue we had a lot of unclosed connection plus we had a lot of these exception:

redis.clients.jedis.exceptions.JedisException: Could not return the resource to the pool
    at redis.clients.jedis.JedisPool.returnResource(JedisPool.java:247)
    at redis.clients.jedis.Jedis.close(Jedis.java:3449)
    at redis.clients.jedis.JedisClusterPipeline.releaseConnection(JedisClusterPipeline.java:278)
    at redis.clients.jedis.JedisClusterPipeline.reset(JedisClusterPipeline.java:288)
    at redis.clients.jedis.JedisClusterPipeline.sync(JedisClusterPipeline.java:314)
    at redis.clients.jedis.JedisClusterPipeline.syncAndReturnAll(JedisClusterPipeline.java:330)
// [..]
Caused by: redis.clients.jedis.exceptions.JedisException: Could not return the resource to the pool
    at redis.clients.util.Pool.returnResourceObject(Pool.java:64)
    at redis.clients.jedis.JedisPool.returnResource(JedisPool.java:244)
    ... 12 more
Caused by: java.lang.IllegalStateException: Object has already been returned to this pool or is invalid
    at org.apache.commons.pool2.impl.GenericObjectPool.returnObject(GenericObjectPool.java:551)
    at redis.clients.util.Pool.returnResourceObject(Pool.java:62)
    ... 13 more

i didn't at time to look more into it :s

Regards.

Unknow0 avatar Jul 22 '19 14:07 Unknow0

Any update?

lcy362 avatar Dec 21 '19 10:12 lcy362

I'd also like to see cluster pipelining as well. Tons of older code that we would have to re-write just to move to newer cluster deployment of redis. Can we move past the religious debate about whether there should be pipelining and add support for it? Have it off by default if you like.

ucjonathan avatar Dec 21 '19 11:12 ucjonathan

Any update?

funaiy avatar Dec 24 '19 03:12 funaiy

Any updates? It's been more than three years now 😅

jaronoff97 avatar Jan 03 '20 15:01 jaronoff97

I just bit the bullet and refactored the code to use JedisCluster and stop pipelining. It actually wasn't as bad as I had expected it to be.

ucjonathan avatar Jan 03 '20 16:01 ucjonathan

I just bit the bullet and refactored the code to use JedisCluster and stop pipelining. It actually wasn't as bad as I had expected it to be.

:D

marcosnils avatar Jan 03 '20 16:01 marcosnils

Any update? Argentina won their third football world cup but this PR is still not merged 🙏

esigma5 avatar Jan 26 '23 00:01 esigma5

@esigma5 Give it at least 36 years.

Enjoy ClusterPipeline for now. https://github.com/redis/jedis/blob/022a9afd244a0d89a20b4a5bd2eef85b25f976c2/src/main/java/redis/clients/jedis/ClusterPipeline.java#L8

sazzad16 avatar Jan 26 '23 10:01 sazzad16