Replication lag in OceanBase appears as growing replay delay on follower replicas for a log stream. Check network latency, disk IO on followers, and leader write rate before changing topology or forcing leader switches.

Replication lag is usually stream-scoped. Cluster-wide metrics can look healthy while one hot log stream accumulates delay.

Symptoms

  • Elevated replay_lag on followers in __all_virtual_log_stat.
  • Read-after-write inconsistency when apps read from non-leader endpoints (misconfiguration).
  • OCP alerts on replication delay thresholds.

Diagnostic steps

SELECT ls_id, role, zone, replay_lag
FROM oceanbase.__all_virtual_log_stat
ORDER BY replay_lag DESC;

Compare lag with disk latency and network metrics on the lagging observer. Check whether a single tenant or tablet dominates write rate.

Remediation paths

CauseDirection
Disk saturation on followerBalance units or upgrade disk class
Network partitionNetwork team; avoid forced writes without quorum
Hot log streamSplit workload or add streams per sizing guide

Validation

Lag trends down for 30+ minutes under normal load. No new leader flapping on the affected stream.

Sources and further reading