# ERR 槽迁移超时，槽 1234

- **ID:** `redis/cluster-slot-migration-timeout`
- **领域:** redis
- **类别:** runtime_error
- **错误码:** `ERM`
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

集群槽迁移操作超过配置的超时时间，通常由网络拥塞或大键迁移导致。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Redis 6.2.0 | active | — | — |
| Redis 7.0.0 | active | — | — |
| Redis 7.2.0 | active | — | — |

## 解决方案

1. ```
   Use CLUSTER SETSLOT MIGRATING to abort the migration and retry with smaller batches. Example: redis-cli -h source-node CLUSTER SETSLOT 1234 MIGRATING destination-node-id; then use redis-cli --cluster reshard with --pipeline 10 to limit key count per migration.
   ```
2. ```
   Increase cluster migration timeout via config: CONFIG SET cluster-migration-timeout 60000 (60 seconds) and retry the migration.
   ```
3. ```
   Identify and split large keys (e.g., >10MB) before migration to avoid timeout.
   ```

## 无效尝试

- **** — Restarting nodes without addressing the underlying migration issue can cause data inconsistency and longer downtime. (70% 失败率)
- **** — Deleting slot data breaks cluster integrity and leads to data loss; the slot must be properly reassigned. (90% 失败率)
- **** — A very high timeout masks the problem and may lead to long stalls; it does not fix the root cause like large keys. (60% 失败率)
