TRYAGAIN Multiple keys request during rehashing of slot: Multiple keys request during rehashing of slot (cluster)
RedisWhat does it mean?
In Redis Cluster, while a hash slot was being moved between nodes (rehashing/resharding), a request containing multiple keys belonging to the same slot was made, and some of the keys had already been moved while others had not. The server asks you to retry the operation shortly.
Why does it happen?
Running a multi-key command (MGET, MSET, multi-key Lua, transaction) while a slot migration is in progress. In the migrating slot some keys are on the source node and some on the target node, so the command cannot be executed atomically.
How to fix it
Catch this error in the client and retry after a short wait (TRYAGAIN is transient; it clears when resharding finishes). For multi-key operations, guarantee that all keys are in the same slot with a hash tag, such as {app_user123}.profile, {app_user123}.settings. Perform cluster rebalancing (resharding) during low-traffic periods.
More from this engine
- ERR MULTI calls can not be nestedMULTI calls can not be nested
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable
- ERR unknown commandUnknown command
- ERR DISCARD without MULTIDISCARD without MULTI
- BUSYGROUP Consumer Group name already existsConsumer group already exists
- NOGROUP No such key or consumer groupNo such key or consumer group in stream
- NOTBUSY No scripts in execution right nowNo scripts in execution right now