fix(backup): let the stopped copy replace a failed live pre-copy

A volume whose containers must stop was copied twice: live first, then
with the containers stopped and --checksum. A live writer that truncates
a file under rsync (read errors mapping ...: No data available (61),
exit 23) aborted the run in the first pass, before the containers were
stopped, although the second pass rewrites every differing file anyway.
Seen in infinito-nexus CI on kix_kix_shared/objecticons.

The live copy now only warns when a stopped copy follows. Without a stop
it stays the only copy and still fails the run, and a failing stopped
copy still fails it.

The e2e test drives a writer that shrinks files mid-read; without the
fix it reproduces the CI failure verbatim.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-23 15:34:19 +02:00
parent 9d4cc24a59
commit 161db213cb
4 changed files with 200 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ def backup_run(
images_no_stop_required: list[str],
images_no_backup_required: list[str] | None = None,
only_sql: bool = False,
) -> None:
) -> subprocess.CompletedProcess:
cmd = [
"baudolo",
"--compose-dir",
@@ -49,7 +49,7 @@ def backup_run(
cmd += ["--only-sql"]
try:
run(cmd, capture=True, check=True)
return run(cmd, capture=True, check=True)
except subprocess.CalledProcessError as e:
print(">>> baudolo failed (exit code:", e.returncode, ")")
if e.stdout: