Skip to content
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

Support for Redis Cluster by providing an alternative to pipelining #786

Open
peteAhn opened this issue Apr 8, 2022 · 2 comments
Open
Labels

Comments

@peteAhn
Copy link

peteAhn commented Apr 8, 2022

After I read the Redis cluster connection in the readme document,
I've tested the sample source connecting the Redis Cluster with 3 nodes.
Then I faced the following error message.

ReplyError: CROSSSLOT Keys in request don't hash to the same slot
return new ReplyError(string)
           ^
ReplyError: CROSSSLOT Keys in request don't hash to the same slot
    at parseError (/home/cr-api-server/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/home/cr-api-server/node_modules/redis-parser/lib/parser.js:302:14) {
  command: { name: 'exec', args: [] },
  previousErrors: []
}

I found out the following issues.

Please let me know the node-resque support a Redis Cluster or not.
Thanks.

@evantahler evantahler changed the title It seems that the node-resque does not support a Redis Cluster. Support for Redis Cluster Apr 8, 2022
@evantahler evantahler changed the title Support for Redis Cluster Support for Redis Cluster by providing an alternative to pipelining Apr 8, 2022
@evantahler
Copy link
Member

evantahler commented Apr 8, 2022

Hi @peteAhn!

Yes, at the moment there are a few places in the code that don't work with Redis Cluster due to pipelining multiple commands together - like this example, as the keys used might be on different nodes. Ideally we do want to sue pipelining as it offers better atomicity.

Redis cluster also likely won't work well with our atomic popAndStore Lua script because again those same keys might be on different nodes. Here's how we currently mitigate this.

Are you able to help us by making a utility method that allows us to use mutli/exec pipelining when available, and falls back to parallel commands when using redis cluster?

In the short term, you can configure the key slots on your redis cluster to guarantee all the keys resque uses are on the same now, and things should work out... but that sort of removes the point of using a cluster to begin with.

@evantahler evantahler added the bug label Apr 8, 2022
@peteAhn
Copy link
Author

peteAhn commented Apr 12, 2022

Hi @peteAhn!

Yes, at the moment there are a few places in the code that don't work with Redis Cluster due to pipelining multiple commands together - like this example, as the keys used might be on different nodes. Ideally we do want to sue pipelining as it offers better atomicity.

Redis cluster also likely won't work well with our atomic popAndStore Lua script because again those same keys might be on different nodes. Here's how we currently mitigate this.

Are you able to help us by making a utility method that allows us to use mutli/exec pipelining when available, and falls back to parallel commands when using redis cluster?

In the short term, you can configure the key slots on your redis cluster to guarantee all the keys resque uses are on the same now, and things should work out... but that sort of removes the point of using a cluster to begin with.

@evantahler

Thanks for your quick response.
When available I will help you, but currently I cannot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants