IlyaSkriblovsky / txredisapi

non-blocking redis client for python twisted
Apache License 2.0
235 stars 91 forks source link

Cluster Moved Command Issue MOVED 9203 10.12.5.66:6379 #125

Open tarikogut opened 6 years ago

tarikogut commented 6 years ago

Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: File "/usr/lib/python2.7/site-packages/jasmin/vendor/txredisapi.py", line 400, in handle_reply Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: raise r Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: jasmin.vendor.txredisapi.ResponseError: MOVED 9203 10.12.5.66:6379 Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: Unhandled error in Deferred: Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: Traceback (most recent call last): Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: File "/usr/lib/python2.7/site-packages/jasmin/vendor/txredisapi.py", line 395, in replyReceived Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: self.replyQueue.put(reply) Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 1515, in put Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: self.waiting.pop(0).callback(obj) Feb 07 14:00:21 DEVSRV-JASMIN02 jasmind[7291]: File "/usr/lib64/python2.7/site-packages/twisted/internet/defer.py", line 393, in callback

IlyaSkriblovsky commented 6 years ago

Unfortunately, txredisapi doesn't work well with Redis Cluster yet. Pull Requests are welcomed :)

tarikogut commented 6 years ago

MOVED mean redirect to ip port then repeat command how to do it ?

IlyaSkriblovsky commented 6 years ago

I'm personally have no experience with Redis Cluster yet (i'm only using Sentinel for failover for now). So I don't have the full picture of how Redis Cluster actually works.

You may try to implement something like we did in TxMongo: https://github.com/twisted/txmongo/blob/master/txmongo/connection.py#L174 See retryNextHost. It replaces host and port attributes of self.connector to make it reconnect to different address.

Unfortunately, I have no time right now to dive into Redis Cluster and investigate it myself :(

tarikogut commented 6 years ago

can i fix ???

IlyaSkriblovsky commented 6 years ago

Sure, that would be great. You can clone this repository and try to fix it yourself.