Track · 2:30 · Liner note

Catching Up with the Replica

After downtime, a replica catches up with its primary by replaying the changes it missed from the primary's log, and how long that takes depends on the size of the backlog and the speed of replay.

After an outage, a replica does not copy the primary’s current state. It replays the changes it missed, in order, from the primary’s log until it is level again. Catching Up with the Replica is that patient process, and its speed depends on the backlog, the network and how fast the replica can apply what it reads.

Watch the lag shrink instead of trusting that it will. Keep reads off the replica until it is level, and do not promote it while it is still behind, or the changes it never saw are lost.