DEV Community

Cover image for Continuous data protection needs checkpoint restart in the AI era
KVMDR
KVMDR

Posted on Edited on

Continuous data protection needs checkpoint restart in the AI era

Continuous data protection replicates changes within seconds. Before it can do that, though, every protected disk needs one full initial sync to the DR site, and after a disaster, failback needs a full copy back. Those first copies are the long jobs in DR. They run for hours or days, over links that drop, against hosts that reboot and storage that fills up.

A job that cannot resume from where it stopped throws away the work already done and leaves the workload unprotected while it starts again. A job that resumes carelessly is worse: it produces a DR copy that boots but holds the wrong data.

This post is a short version of our white paper. The full paper is free to download: Continuous Data Protection Needs Checkpoint Restart in the AI Era (PDF).

Why the AI era raises the stakes

Training data, model weights, feature stores and vector databases push single VMs into the multi terabyte range. Bigger disks mean longer initial syncs, and pipelines that ingest and retrain write continuously, so more changes are in flight at any moment. The AI world solved the same problem for training runs long ago: a run that cannot restart from its last checkpoint is a run that cannot finish. Data protection needs the same discipline.

What a restart from zero costs

The time to copy a disk once at full line rate, before protocol overhead:

Disk size 100 Mbps 1 Gbps 10 Gbps
1 TB 22 hours 2.2 hours 13 minutes
4 TB 3.7 days 8.9 hours 53 minutes
10 TB 9.3 days 22 hours 2.2 hours

A 4 TB VM over 100 Mbps that fails at 90% loses more than three days if the job cannot resume, and has no DR copy for another 3.7 days.

Five rules for checkpoint restart

  • Durable before marked. Record a piece of work as done only after fsync on the receiving storage, or a flush on the platform. A crash before the mark just means that piece is redone.
  • Safe to repeat. Write every piece to a fixed position or under a temporary name, so doing it twice gives the same result as doing it once.
  • Ordered replay. Apply changes oldest first. New writes queue behind a backlog, never ahead of it.
  • Verify after a crash. After a controlled pause, trust the progress map. After an unclean stop, check the completed work before continuing.
  • Visible progress. Every long job shows where it is. There is never a silent wait.

How KVMDR applies them

Initial sync. Each disk is copied in chunks of 64 MB to 1 GB, with a per chunk map in the manager database. Change tracking is switched on before the first chunk is read, so writes that land in chunks already copied are picked up by the first replication cycle. A resumed job starts at the first unfinished chunk. After a crash, completed chunks are hash checked on both sides and only the ones that differ are copied again.

Chunked initial sync: what survives an interruption

oVirt, OLVM and RHV. The copy runs through the platform backup API. The backup is held open across a pause, so a resumed download returns the same point in time. If no progress is made for 4 hours an alert is raised, and after 24 hours the backup is released so the VM is not blocked.

Near sync replication. Once the initial sync is done, replication runs seconds behind. Each delta is journalled in the repository. A delta that reached the repository but not yet the DR disk carries an unapplied marker, so point in time recovery never assumes the DR disk is current when it is not.

DR site outage. Deltas wait safely in the repository. When the site returns, the backlog is applied oldest first and new writes queue behind it, with no agent restart and no manual step.

Ordered replay after a DR site outage

Secure transport. Over the TLS channel, each file is sent under a temporary name, checked with SHA256, fsynced and only then renamed into place. After a broken link, files the receiver already holds with a matching SHA256 are skipped.

Failback, Simulation and platform calls. Failback full copies resume from the same chunk map, Simulation baseline uploads resume per disk, and reads are retried while writes that time out are never repeated, so nothing is created twice.

The result

An interruption costs only the time the link was down, never the hours or days of work already done, and the DR copy stays correct.

Download the full white paper (PDF)

Top comments (0)