-
Notifications
You must be signed in to change notification settings - Fork 380
Open
Description
We require to know to which shard the redis command will be sent. The reason is that we a re implementing a migration procedure from one redis cluster to another, and we need to know if the redis shard is under migration or not, so that the DB clients can then switch to the other redis cluster.
I think a good solution for this could be:
- Create a variant of the ShardPool::fetch() method, which also returns the shard index or shard name
- Expose this variant via the RedisCluster class
- Create a variant of the RedisCluster ::eval(), evalsha() and RedisCluster ::command() functions, which will accept the shard as an argument, This is only for performance, because the client that has already called fetch() already knows the shard and can then pass the shard to the eval() or command, in order to avoid the extra call to ShardPool::fetch().
Actually 3) is optional, as it is only for better performance. Most important for our purposes are 1) and 2).
We have considered other alternatives, mainly to synchronize the DB clients to switch to the other redis cluster. However using the redis itself to synchronize provides the best guarantees for data consistency.
Do you think implementing something like the above is possible?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels