At a glance
Alerts for Unavailable or Under-Replicated Ranges: the firing list for the two most serious states a CockroachDB range can be in. This card is CockroachDB-distinctive, it watches the replication layer that no single-node database has. An unavailable range has lost quorum: some of your data cannot be read or written right now. An under-replicated range has fewer healthy replicas than the configured replication factor: it still works, but it is one more failure away from going unavailable. Any unavailable range is a data-availability incident, full stop. Sustained under-replication is the warning that the cluster cannot self-heal fast enough.
Calculation
CockroachDB splits all data into ranges, and each range is replicated (by default 3 replicas, sometimes 5 for system or critical ranges). The replicas form a Raft group that needs a majority (quorum) to commit reads and writes. This card watches two range-state counters:ranges.unavailable) counts ranges that have lost quorum: too many replicas are on dead or partitioned nodes for the Raft group to reach a majority. While a range is unavailable, statements touching its key span block or error. This is the data-availability emergency arm, so it is treated as urgent the instant the counter is non-zero.
Under-replicated (ranges.underreplicated) counts ranges that currently have fewer live replicas than their configured replication factor (for example 2 live replicas on a range configured for 3). The range still has quorum and works, but it has lost its safety margin: one more replica failure could push it to unavailable. CockroachDB normally self-heals this by up-replicating onto a healthy node within minutes. Because brief under-replication is expected during rolling restarts, node decommissioning, and rebalancing, the under-replicated arm requires a sustained 5-minute breach before it fires. A sustained breach means the cluster cannot self-heal, usually because a node is down, the balancer is overloaded, or there is nowhere healthy to place the missing replica.
Each firing carries the unavailable count, the under-replicated count, and the nodes/stores implicated so the on-call engineer can map ranges to failed hardware.
Worked example
A platform team runs a 6-node CockroachDB cluster, replication factor 3, spread across three availability zones (two nodes per zone). Snapshot taken on 18 Apr 26 at 03:20 BST, after a zone-level network incident took two nodes offline at 03:08.
When zone B’s two nodes dropped at 03:08, every range that had a replica on those nodes immediately went under-replicated (2 live replicas instead of 3). The cluster began up-replicating onto the four remaining nodes. But 38 ranges had two of their three replicas in zone B, so losing both at once cost those ranges their quorum: they went unavailable. The under-replicated count also stayed high past the 5-minute window because four nodes could not absorb the rebalancing fast enough. The card fired at 03:20 on both arms.
What the on-call SRE does with this:
- Treat unavailable as the priority. 38 unavailable ranges means a slice of the keyspace is unreadable and unwritable. Cross-read Unavailable Ranges for the live count and which tables those ranges back. The fastest recovery is to bring the two zone-B nodes back: restoring even one of them can hand quorum back to those 38 ranges instantly.
- Confirm the node loss. Check Cluster Node Count and Active Nodes (status=live). Both should read 4, confirming the two-node loss is the root cause rather than a metrics artefact.
- Decide on the under-replication path. If the zone-B nodes are coming back within minutes, do nothing further: the under-replicated ranges will re-replicate onto the returning nodes and the unavailable ranges recover. If the nodes are gone for good, the cluster will eventually re-replicate the survivors onto the four healthy nodes, but only the unavailable ranges that still have at least one surviving replica can recover. Ranges that lost all replicas in zone B require restore from backup, which is why Last Successful Backup (hours ago) matters at exactly this moment.
- Unavailable and under-replicated are not the same severity. Under-replicated is a warning (safety margin lost, usually self-heals). Unavailable is an active outage (data cannot be served). The card fires on either, but you triage unavailable first, always.
- Sustained under-replication means self-healing failed. A brief blip during a restart is normal and will not fire. A 5-minute-plus breach means the cluster cannot place the missing replicas: a node is down, disks are full, or placement constraints leave nowhere legal to put them.
- Backups are the floor under this card. If a range loses every replica, no amount of cluster recovery brings it back; only a restore does. The freshness of your backup is the difference between minutes of recovery and permanent data loss.
Sibling cards
Reconciling against the source
Where to look natively:DB Console Replication dashboard for the “Under-replicated Ranges” and “Unavailable Ranges” panels (the canonical live view). DB Console Problem Ranges report (Advanced Debug page) to list the specific ranges, their replicas, and which nodes hold them.Why our number may legitimately differ from the native view:SELECT range_id, unavailable, under_replicated FROM crdb_internal.ranges WHERE unavailable OR under_replicated;to enumerate the affected ranges and trace them to tables.cockroach node status --rangesfor the per-node replica and range health view. CockroachDB Cloud Metrics tab plots the sameranges.unavailableandranges.underreplicatedseries; the cluster page flags replication health.
Cross-connector reconciliation: