At a glance
How far behind the slowest follower replica is in applying the Raft log, measured in seconds. CockroachDB replicates every range across multiple nodes using the Raft consensus protocol; a write is committed once a quorum acknowledges it, but follower replicas still need to catch up to the leader. This card reports the worst replication lag observed across the cluster. A healthy cluster keeps quiescent ranges (idle ranges drop out of Raft heartbeating to save CPU) and shows near-zero lag on active ranges. Sustained lag means a follower is falling behind: a sign of a slow disk, a saturated network link, an overloaded node, or a snapshot in flight. For an SRE this is the early-warning gauge for a node that is about to become unhealthy or under-replicated.
| Data source | CockroachDB replication metrics, principally raft.process.applycommitted.latency, raft.commandsapplied, and the follower-behind signals derived from raftlog.behind, exposed via _status/vars and the cluster status endpoints. Vortex IQ surfaces the cluster-wide worst-case lag. |
| What it tracks | Raft Quiescent Lag (seconds): the maximum time a follower replica is behind its leaseholder in applying committed Raft log entries, across all active ranges. Quiescent (idle) ranges contribute zero. |
| Metric basis | Replica catch-up lag, not write commit latency. A write can commit at quorum while a non-quorum follower lags; this card measures that follower gap, which matters for failover safety and read-follower freshness. |
| Time window | RT (real-time, refreshed continuously from the cluster status layer). |
| Alert trigger | > 10s. A follower more than 10 seconds behind is at risk of triggering a snapshot, of leaving a range under-replicated if the leader fails, and of serving stale follower reads; the Nerve Centre raises this as a sensitivity event. |
| Units | Seconds. Derived from the Raft apply position and command timing; Vortex IQ normalises to seconds for display. |
| Scope | Cluster-wide worst case across all live nodes and active ranges. |
| Roles | owner, engineering, operations |
Calculation
CockroachDB tracks, per range, how far each follower replica has progressed through the committed Raft log relative to the leaseholder. When a follower’s applied index trails the committed index, that range has replication lag; Vortex IQ converts the worst follower’s position into an elapsed-seconds estimate using the command apply timing. The displayed number is derived as follows:- Read the replication and Raft metrics from each live node’s status endpoint: the per-range follower-behind signals and
raft.process.applycommitted.latency. - Exclude quiescent ranges. Idle ranges deliberately stop Raft heartbeating to save CPU and have no meaningful lag; counting them would create false signal.
- Take the cluster-wide maximum lag across all active ranges and their followers. This is a worst-case gauge by design: one badly-lagging follower is the thing you need to know about, and averaging would hide it.
- Normalise to seconds and compare against the
> 10ssensitivity threshold. A sustained breach flips the card to alert and feeds the sensitivity layer.
Worked example
A platform team runs a 5-node CockroachDB cluster (v23.2) with the default replication factor of 3. Baseline quiescent lag sits at well under 1 second. Snapshot taken on 03 Jun 26 at 21:18 BST, shortly after a node was restarted for an OS patch.| Node | Live | Role for hot ranges | Worst follower lag (s) | Disk write p99 (ms) |
|---|---|---|---|---|
| n1 | yes | leaseholder | 0.2 | 4 |
| n2 | yes | follower | 0.3 | 5 |
| n3 | yes | follower | 0.2 | 4 |
| n4 | yes | follower | 14.6 | 210 |
| n5 | yes | follower | 0.4 | 6 |
- Lag right after a node rejoins is normal; lag that does not fall is not. The shape over time is everything. A steadily declining figure after a restart or rebalance is the cluster healing. A flat, sustained figure is a node that cannot keep up and needs investigation.
- Always pair lag with the under-replication view. A lagging follower is only a safety problem if it means a range is short of up-to-date replicas. Under-Replicated Ranges tells you whether the lag has crossed into real risk.
- The cause is almost always node-local resources. Disk write latency, CPU saturation, or a constrained network link on the lagging node. Find the node first (the per-node view localises it), then check that node’s disk and CPU before suspecting CockroachDB itself.
Sibling cards
| Card | Why pair it with Raft Quiescent Lag | What the combination tells you |
|---|---|---|
| Under-Replicated Ranges | Tells you whether the lag has become a replication-safety problem. | Lag plus rising under-replicated count equals real risk; lag alone with zero under-replicated is usually benign catch-up. |
| Unavailable Ranges | The worst case the lag can degrade into. | If lagging followers tip a range below quorum, ranges go unavailable; this is the data-loss-risk gauge. |
| Active Nodes (status=live) | Confirms whether a node has dropped out versus merely lagging. | Lag with a full live count equals a slow node; lag with a missing node equals a recovery in progress. |
| Cluster Node Count | The expected membership baseline. | A node lost from the count explains a sudden lag and under-replication spike. |
| Replicas per Node | Shows replica distribution and rebalancing. | A node taking on many replicas (rebalance/recovery) will show transient lag while it catches up. |
| Decommissioning Nodes | A decommission drains ranges and can drive transient lag. | Lag during a decommission is expected; lag that stalls means draining is stuck. |
| Database Disk Usage % | Disk pressure is a common lag cause. | High disk usage plus high lag on the same node points at storage as the bottleneck. |
| CockroachDB Health Score | The composite that weights replication health. | Sustained lag pulls the health score down and confirms cluster-level impact. |
Reconciling against the source
Where to look in CockroachDB’s own tooling:DB Console → Metrics → Replication dashboard carries the “Replicas per Store”, “Snapshots”, and follower-behind charts. The “Replica Quiescence” panel shows the quiescent vs active split. DB Console → Advanced Debug → Problem Ranges lists ranges with replication issues, including raft-log-behind followers.Why our number may legitimately differ from the DB Console:SELECT * FROM crdb_internal.kv_store_statusandcrdb_internal.rangesexpose per-range and per-store replication state from SQL.cockroach node status --rangesfrom the CLI shows per-node range and leaseholder counts, useful for localising a lagging node. For CockroachDB Cloud (Dedicated), the same Replication dashboard is available under Monitoring in the Cloud Console; the metrics export feeds the identical replication metric names to Prometheus/Datadog.
| Reason | Direction | Why |
|---|---|---|
| Worst-case vs charted series | Vortex IQ higher | This card reports the single worst follower across the cluster; the DB Console default chart often shows a per-store or aggregate series that does not isolate the one bad replica. |
| Quiescent exclusion | Vortex IQ lower in count | Vortex IQ excludes quiescent ranges from the lag calculation; some raw metric views include them at zero, diluting any per-range average. |
| Refresh cadence | Brief disagreement | The card is real-time but polls on an interval; a fast-moving recovery can show different values on the two sides within the same minute. |
| Seconds vs index lag | Presentation | CockroachDB internally tracks lag as a log-index gap; Vortex IQ converts to elapsed seconds using apply timing, which is an estimate, not an exact clock. |
| Time zone | Axis labels shift | The DB Console renders in node-local time; Vortex IQ renders in your reporting time zone. |
| Card | Expected relationship | What causes divergence |
|---|---|---|
crdb_unavailable_or_under_replicated | Sustained high lag should precede or accompany under-replication alerts. | Lag without under-replication is benign catch-up; lag that does not resolve into either recovery or under-replication suggests a metric or polling artefact to investigate. |
| Host disk/CPU metrics (any infra connector) | A lagging node should show elevated disk write latency or CPU on the same host. | Lag with no host-resource pressure is unusual and worth a closer look at the network link. |