-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Error: All keys in the pipeline should belong to the same slots allocation group #1602
Comments
Hey @arthosofteq 👋,
The 2 keys belong to two different slots, although the two slots may be severed by the same shard at the moment. Ioredis doesn't know that before it reaches to server, so it throws early without sending them to the server to ensure the semantic of a pipeline. I think it's risky to assume that two slots always belong to the same shard as it could be false after a failover or cluster re-setup. Generally, if you want to use pipeline in cluster, you need to ensure that they are not only severed by the same shard, but also they belong to the same slot. Hope that makes sense. Regarding the second issue, I'm not able to reproduce it as 'memory usage' is not a valid command (I assume you mean |
Stumbled onto this error message. @luin, I'm curious, what do you mean by 'ensure the semantic of a pipeline'? A pipeline is not a transaction, some operations may fail. I have not studied the topic too deeply, but initially seems like it might be reasonable for a Redis client library to provide 'best-effort' (up to a number of redirects) handling of multi-slot pipelines and ultimately (if still rebalancing), report that some operations failed. The standard CLI client handles multi-slot pipelines:
Jedis seems to handle multi-slot pipelines as well: |
Same issue, @luin I have keys which are belonging to different slots/nodes and i am expecting it to work just as @undeadcat cli request.. since the whole intention of |
Any updates here? |
There is an error when trying to execute pipeline on
IORedis.Cluster
instance.I'm sure that data belongs to a single shard. When I get some particular node using
.getNodes
and execute pipeline on that particular node (IORedis.Redis
instance) it works fineEnvironment:
Data example:
These 2 keys should be allocated to the same shard.
Will throw an error:
All keys in the pipeline should belong to the same slots allocation group
But if you pick any node from the target shard and execute the same pipeline on it (
<IORedis.Redis>.pipelien(...).exec()
) it will work fine (just to prove that keys belongs to the same shard)Also interesting thing:
Will fail with the same error when:
will not
The text was updated successfully, but these errors were encountered: