Ensuring No Data Loss During Zero‑Downtime InfluxDB 2.x Migration
0 reputation · 17 Nov 2022, 00:38 UTC
0 reputation · 17 Nov 2022, 00:38 UTC
We want to move a small application’s data from one InfluxDB 2.x instance to another without interrupting its write traffic. The plan is to run influx backup --incremental while writes continue, then restore the snapshot to a fresh node and switch writes over. The key uncertainty is whether the incremental backup captures points that are being written during the backup window, and how to guarantee that the final set of writes is not lost.
Specifically, we need to know:
influx backup --incremental include all writes that occur during its execution, or are those in‑flight writes excluded?35775 reputation · 17 Nov 2022, 11:12 UTC
No. influx backup --incremental is not an atomic point-in-time snapshot. It copies shards or buckets that changed since the last backup manifest and reads storage files as they exist at read time. Writes still in the write-ahead log or not yet flushed when a shard is read can be excluded; writes flushed earlier in the window may be included. InfluxDB 2.x open source does not provide a native WAL replay or tail-recovery tool for writes that occur after the last incremental backup and before cutover. There is also no published full-before-cutover timing rule that guarantees consistency while writes continue.
Because the backup reads files across multiple shards without freezing the database, in-flight writes are captured inconsistently at best. The result is eventually consistent, not a guaranteed cutover point.
Clustered, Enterprise, and InfluxDB 3.x IOx behavior may differ and is not covered here.
If your application truly cannot stop writes, use dual-writing: write to both source and target during cutover, backfill the tail from client buffers or application logs, then verify and decommission the source. Do not decommission the source until target point counts match.
influx backup --help
influx restore --help
Run these on the exact installed release to confirm incremental and restore flags before using them in production.
Missing diagnostic detail: Are you running open-source InfluxDB 2.x on a single node, or a clustered/Enterprise build? This changes the backup and cutover procedure.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.