// Redis error reference

NOREPLICAS: Too few healthy replicas to write

With min-replicas-to-write set, the primary refuses writes when fewer than that many replicas are connected and within the lag bound.

Error prefix
NOREPLICAS
Categoría
Cluster and replication
Mensaje de error
NOREPLICAS Not enough good replicas to write.

Qué significa

NOREPLICAS is a write-availability guard. When min-replicas-to-write and min-replicas-max-lag are set, the primary tracks how many replicas are connected and acknowledging within the lag window, and it refuses writes while that count is short. The point is bounded data loss: a primary that cannot replicate should not be accepting writes nobody will see if it dies.

It reads like a replica-side error, but it is the primary refusing. Typical triggers are network partitions that silence replicas, replicas down for maintenance, and lag bounds set tighter than the workload allows, so the guard trips even though the replicas are technically connected.

Causas comunes

  • Replicas are disconnected, crashed or cut off by the network, and the connected count fell below the minimum.
  • Replicas are connected but too slow: their acknowledgements exceed min-replicas-max-lag seconds.
  • The bounds were configured for an older topology and no longer match the fleet.

Find the cause

INFO replication
# The connected replicas with their lag
CONFIG GET min-replicas-*
redis-cli -h replica-1 INFO replication | grep master_link_status
# Are the replicas healthy from their own point of view?

Cómo solucionarlo

  1. Compare the healthy-replica count with the configured minimum:

    INFO replication
    CONFIG GET min-replicas-to-write
    CONFIG GET min-replicas-max-lag
  2. Restore connectivity or capacity to the replicas; writes resume automatically once the guard is satisfied.

  3. Relax the guard only consciously, such as for a maintenance window. CONFIG SET takes effect at once but is lost on restart. To persist it, set min-replicas-to-write in the config file the server was started with, then run CONFIG REWRITE (it fails with "The server is running without a config file" when the server was started from the command line):

    CONFIG SET min-replicas-to-write 0
    CONFIG REWRITE

Other ways to handle it

The two settings work as a pair: a wide lag bound tolerates slow replicas, a low minimum tolerates fewer of them. Redis Sentinel fails over when it marks the master down (+sdown/+odown), and a primary that still answers PING while refusing writes does not meet that test, so Sentinel does not clear a NOREPLICAS guard. Restoring replica health is the fix.

Reprodúcelo de forma segura

redis-server --port 7311 --min-replicas-to-write 1 --min-replicas-max-lag 10 --save '' &
redis-cli -p 7311 SET foo bar
# (error) NOREPLICAS Not enough good replicas to write.

Preguntas

Why is my healthy primary refusing writes?

It is the durability guard: not enough replicas are acknowledging in time. The primary itself is fine; its replication is not.

Does this apply to Redis Cluster?

Yes, per primary. A cluster primary with the guard configured also refuses writes when its replica count dips below the minimum.

Errores relacionados

More cluster and replication errors

El código y el texto del mensaje son de Redis documentation and source code. Explora la lista completa de Redis error list o buscar cada error de base de datos.

// menos errores, correcciones más rápidas

Work on Redis in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for Redis and the other databases you use.

Texto y datos de esta página: CC BY 4.0, con atribución a SQLly (sqlly.app). Código y fragmentos SQL: MIT. Detalles de la licencia El texto citado de los mensajes de error pertenece a su proveedor de base de datos.