-
Notifications
You must be signed in to change notification settings - Fork 346
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
[Urgent!!!!!!] worker will report cross slot error when working with redis cluster #93
Comments
@shdunning any comments? |
I suspect this has something to do with the Lua scripts referencing keys that aren't defined on that node where the Lua script is running -- like our Lua script for fetching the next job, which requires 5 keys: (1) job queue (2) in progress queue (3) pause key (4) lockKey (5) lock info key (6) set concurrency key. We'll likely need to investigate how to make these Lua scripts cluster-safe. |
@steven-zou What commit are you running? I believe we were constructing keys in a lua script at one point, which would cause this error, but we fixed this in #52 |
Thanks, @austintaylor. After rough checking, there might be a mistake when importing work library into our project with |
@steven-zou if it's any help, we've been having better luck with https://github.com/kardianos/govendor instead of |
Have the same issue on 0.5.1, when using an elasticache instance I get the
|
@stefanoschrs any luck fixing this on 0.5.1? |
Nope, nothing.. |
@stefanoschrs I ended up switching out the clustered Redis instance for a normal one to get around this. |
That's what I did also, but it's not a solution.. |
Yes, check with v0.5.1, the issue still is there. Any bits of advice? @shdunning @austintaylor |
Just push up: |
@steven-zou i would need to do some digging. this (normally) occurs if we are dynamically referencing a key in the lua scripts instead of explicitly passing them in via the |
@shdunning |
@steven-zou when you're initializing your worker pool, can you try setting your namespace to to begin and end in Hopefully this is easy enough for you to try out and get back to us. |
I'll have a try following the way you mentioned. Will let u know the results later. Thanks. |
Cool. If that works, we can update the README for now with this info. I'll also create a followup issue to see what it would take to make this lib redis-cluster (we use redis sentinel and have no issues, but that doesn't do key distribution across the nodes like redis cluster). |
We tried, putting namespace key in {} does work well. Thanks. I'll close this issue as the way you mentioned can fix the problem with an easy way. |
@steven-zou nice! I'm glad this worked. Note that this isn't an ideal solution because it forces all of the gocraft/work keys onto one node in the cluster. I need to think some more on how we would solve this problem for real; that is, allow gocraft/work LUA scripts to take advantage of multi-node redis clusters. I'll create a separate issue for that. |
Hi folks, We have tried to run work in a Redis cluster hosted by AWS ElastiCache and we have got some issues. The first issue was the one commented ( The second issue is that we're getting If we understood correctly, it's the client that should do the redirection when it gets We are wondering how we can configure work to use a Redis cluster because it's based on github.com/gomodule/redigo and we found that it doesn't support a redis cluster. Could help us telling what are we missing? Thank you ver much in advance. EDIT Our current AWS ElastiCache Redis is formed by 2 nodes redis (v5.0.0) cluster in multi-AZ; using 1 shards, 1 master/1 slave. In case that this information could help to give us an answer. |
@ifraixedes Hi, Did you find the fix for above issue? I am also facing the same. |
@pranayvarma77 I cannot remember. That was a long time ago, and I stopped working on it a month after I posted. |
Apr 11 22:53:03 172.18.0.1 jobservice[971]: message repeated 439 times: [ ERROR: worker.fetch - CROSSSLOT Keys in request don't hash to the same slot]
Apr 11 22:53:03 172.18.0.1 jobservice[971]: ERROR: requeuer.process - CROSSSLOT Keys in request don't hash to the same slot
Apr 11 22:53:03 172.18.0.1 jobservice[971]: ERROR: requeuer.process - CROSSSLOT Keys in request don't hash to the same slot
Apr 11 22:53:03 172.18.0.1 jobservice[971]: ERROR: worker.fetch - CROSSSLOT Keys in request don't hash to the same slot
https://stackoverflow.com/questions/38042629/redis-cross-slot-error
NOTES: jobservice is our component name.
The text was updated successfully, but these errors were encountered: