# Error: Timeout waiting for replica acknowledgment during failover

- **ID:** `redis/redis-timeout-while-waiting-for-replica-ack`
- **Domain:** redis
- **Category:** runtime_error
- **Error Code:** `ERR`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| redis 6.2 | active | — | — |
| redis 7.0 | active | — | — |
| redis 7.2 | active | — | — |

## Workarounds

1. **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`.** (80% success)
   ```
   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`.
   ```
2. **Use `CLUSTER FAILOVER FORCE` on a replica that is synced within acceptable lag to trigger a forced failover without waiting for all replicas.** (75% success)
   ```
   Use `CLUSTER FAILOVER FORCE` on a replica that is synced within acceptable lag to trigger a forced failover without waiting for all replicas.
   ```
3. **Optimize network between master and replicas: use dedicated links or lower latency paths. Monitor with `redis-cli --latency` to identify bottlenecks.** (70% success)
   ```
   Optimize network between master and replicas: use dedicated links or lower latency paths. Monitor with `redis-cli --latency` to identify bottlenecks.
   ```

## Dead Ends

- **Increasing the timeout in redis.conf to 300 seconds** — Higher timeout may mask underlying issues like replica lag or network problems; failover can still fail if replicas are too far behind. (65% fail)
- **Manually promoting a replica to master without waiting** — Forcing promotion can cause data loss if the replica is not fully synchronized; the new master may miss recent writes. (90% fail)
- **Disabling replication checks altogether** — Turning off replication checks compromises data consistency and can lead to split-brain scenarios. (95% fail)
