DBAtlas · Database operations atlas

TRYAGAIN Multiple keys request during rehashing of slot: Multiple keys request during rehashing of slot (cluster)

Redis

What 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.

Open in DBAtlas →

More from this engine