Why Does Redis Cluster Migration Fail If It Uses Built-in Keys and Cross-Slot Lua Scripts?
If your source Redis Cluster uses a cross-slot Lua script with built-in keys and it fails to be migrated to a cluster DCS instance, you can use a master/standby or read/write splitting instance as the target.
In scenarios where slot distribution changes, such as cluster scaling and slot migration, errors may incur in running a cross-slot Lua script with built-in keys. Therefore, cross-slot Lua scripts with built-in keys are not recommended for Redis Cluster instances.
![](https://support.huaweicloud.com/eu/dcs_faq/public_sys-resources/note_3.0-en-us.png)
- Built-in keys: Keys are written in the Lua script instead of being input through a function.
- Cross-slot: All slots in a Lua script are on one shard.
Symptom
Online migration or backup import may fail when the source instance is a Redis Cluster that uses a cross-slot Lua script with built-in keys.
Solution
Select a master/standby or read/write splitting instance as the target.
Suggestion
Do not use cross-slot Lua scripts with built-in keys for Redis Cluster instances.
![](https://support.huaweicloud.com/eu/dcs_faq/public_sys-resources/note_3.0-en-us.png)
- Redis Cluster instances support cross-slot Lua scripts with built-in keys:
- Built-in keys: Keys are written in the Lua script instead of being input through a function.
- Cross-slot: All slots in a Lua script are on one shard.
- In scenarios where slot distribution changes, such as cluster scaling and slot migration, errors may incur in running a cross-slot Lua script with built-in keys.
Data Backup, Export, and Migration FAQs
- Can I Migrate Data from a Lower Redis Version to a Higher One?
- What Should I Consider When Transferring or Operating Data Between Different OSs?
- Can I Migrate Data from a Multi-DB Source Redis Instance to a Cluster DCS Redis Instance?
- What Are the Constraints and Precautions for Migrating Redis Data to a Cluster Instance?
- What Should I Consider for Online Migration?
- Can I Perform Online Migration Without Any Service Interruption?
- What If "Disconnecting timedout slave" and "overcoming of output buffer limits" Are Reported on the Source Instance During Online Migration?
- How Do I Export DCS Redis Instance Data?
- Why Is Memory of a DCS Redis Instance Unchanged After Data Migration Using Rump, Even If No Error Message Is Returned?
- Where Are DCS Instance Backup Files Stored? How Many of Them Can Be Stored?
- Is All Data in a DCS Redis Instance Migrated During Online Migration?
- When Will AOF Rewrites Be Triggered?
- What Are the Common Causes of Redis Migration Failures?
- Can I Migrate Data to Multiple Target Instances in One Migration Task?
- How Do I Enable the SYNC and PSYNC Commands?
- Will the Same Keys Be Overwritten During Data Migration or Backup Import?
- Why Does Redis Cluster Migration Fail If It Uses Built-in Keys and Cross-Slot Lua Scripts?
- Handling Migration Errors
- Troubleshooting Data Migration Failures
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more