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_lagon 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
| Cause | Direction |
|---|---|
| Disk saturation on follower | Balance units or upgrade disk class |
| Network partition | Network team; avoid forced writes without quorum |
| Hot log stream | Split 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.