#4032·valkey

Sync replication: sync-replica counting, quorum gate, and write rejection

Author: jjuleslasarteCreated Jun 23, 2026Updated Sep 25, 2026

Implement unified In-Sync Replica (ISR) counting and quorum-gate logic. A single getSyncReplicaCount() iterates server.replicas counting those with is_in_sync && REPLICA_STATE_ONLINE. A thin predicate checkSyncReplicasStatus() wraps it (count >= min_sync_replicas). Includes an early-return O(1) path when listLength(server.replicas) == 0 (fail-closed: writes rejected), and an error response using a dedicated -NOSYNCREPLICAS prefix.

Dependencies

Depends on #4031