ERR
redis
runtime_error
ai_generated
partial
错误:故障转移期间等待副本确认超时
Error: Timeout waiting for replica acknowledgment during failover
ID: redis/redis-timeout-while-waiting-for-replica-ack
78%修复率
82%置信度
1证据数
2024-04-12首次发现
版本兼容性
| 版本 | 状态 | 引入 | 弃用 | 备注 |
|---|---|---|---|---|
| redis 6.2 | active | — | — | — |
| redis 7.0 | active | — | — | — |
| redis 7.2 | active | — | — | — |
根因分析
在Redis哨兵或集群故障转移期间,主节点等待副本确认数据同步,但网络延迟或副本滞后导致超时过期。
English
During a Redis Sentinel or cluster failover, the master waits for replicas to acknowledge data synchronization, but network latency or replica lag causes the timeout to expire.
官方文档
https://redis.io/docs/latest/operate/oss_and_stack/management/replication/解决方案
-
Check replica lag with `INFO replication` and reduce it by ensuring replicas have sufficient resources (CPU, network). If lag is high, temporarily increase `repl-timeout` in redis.conf: `repl-timeout 120`.
-
Use `CLUSTER FAILOVER FORCE` on a replica that is synced within acceptable lag to trigger a forced failover without waiting for all replicas.
-
Optimize network between master and replicas: use dedicated links or lower latency paths. Monitor with `redis-cli --latency` to identify bottlenecks.
无效尝试
常见但无效的做法:
-
Increasing the timeout in redis.conf to 300 seconds
65% 失败
Higher timeout may mask underlying issues like replica lag or network problems; failover can still fail if replicas are too far behind.
-
Manually promoting a replica to master without waiting
90% 失败
Forcing promotion can cause data loss if the replica is not fully synchronized; the new master may miss recent writes.
-
Disabling replication checks altogether
95% 失败
Turning off replication checks compromises data consistency and can lead to split-brain scenarios.