How Do I Resolve the Error "CROSSSLOT Keys in request don't hash to the same slot"?
Scenarios
When multi-key commands are executed in a GeminiDB Redis instance, the error "CROSSSLOT Keys in request don't hash to the same slot" may be reported.
Error Cause
Commands involving multiple keys were executed across slots in a GeminiDB Redis cluster instance. For example, EVAL and BRPOPLPUSH were executed across slots.
Solution
- Change key names and use hash tags to ensure that the involved keys are in the same slot. Avoid data skew when you use hash tags. For more information, see Which Commands Require Hash Tags in GeminiDB Redis Cluster Instances?.
- When hash tags cannot be used, change the instance type to primary/standby. For details, see Compatible APIs and Versions.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.