DBAtlas · Database operations atlas

CROSSSLOT: CROSSSLOT Keys in request don't hash to the same slot

Redis

What does it mean?

In Redis Cluster, a multi-key command (e.g. MGET, MSET, SUNION) was used, but the keys fall into different hash slots. Multi-key operations require all keys to be in the same slot.

Why does it happen?

In cluster mode, commands accessing several keys at once are called with keys spread across different slots. Keys are distributed to different nodes because they do not use a hash tag.

How to fix it

Use a hash tag to put related keys in the same slot: pin part of the key name with curly braces (e.g. {user1}:profile and {user1}:settings go to the same slot). Use multi-key commands only with keys sharing the same hash tag. Alternatively, split operations into single-key commands.

Open in DBAtlas →

More from this engine