CodisLabs / jodis

A java client for codis based on Jedis and Curator
MIT License
217 stars 97 forks source link

jodis如何保证proxy下线时获取的client可用?(ZK通知有延迟、感知proxy下线需要时间) #59

Open flyfeifei66 opened 5 years ago

flyfeifei66 commented 5 years ago

ZK感知proxy下线需要几秒钟的时间,这时客户端获取client会不会不可用?

Apache9 commented 5 years ago

会的,这个按照目前jodis的设计没法避免

flyfeifei66 commented 5 years ago

会的,这个按照目前jodis的设计没法避免

啥意思?借鉴dubbo等RPC的做法,都有failover重试的。

Apache9 commented 5 years ago

Jodis就是在Jedis上简单包了一层,你之后请求出错什么的都直接是Jedis处理了,Jodis那个wrapper啥信息也拿不到。想支持failover重试的话得大改了

liaozhenyi commented 5 years ago

可以稍微改造一下proxy,下线前先摘ZK的临时节点,等待一会再退出,等待过程继续对外提供服务。