Repository navigation
v1.8.2
A correctness fix to the backup loop, and it is worth reading even if the symptom never reached you.
The archive is read back before it is called a backup
The library tarball was renamed into place on tar's exit code alone. That code has never been a statement about whether the file it produced opens, and the gap is not theoretical: an archive truncated after tar had already exited still carries exit status 0. The old condition promoted it, logged Data backup OK, and pruned older archives around it.
Measured in the image this sidecar actually runs, rather than argued from the manual:
| case | tar's exit code | old condition | with the read-back |
|---|---|---|---|
| a good archive | 0 | promoted | promoted |
| destination blocked by a directory | 2 | refused | refused |
| archive truncated after tar exited | 0 | promoted | refused |
One tar -tzf between the write and the rename now decides it.
What is deliberately not changed
The database dump. It is written as pg_dump \| gzip > f.partial under set -o pipefail, where a failure at either end of the pipe — including a full disk — already fails the pipeline and nothing is renamed. Adding gzip -t there would be noise, not safety.
How it was found
A rule was added to fleet-ops asserting this property across every repository, after one loop turned out to be missing it. Eighteen were, all with the same shape, all fixed in the same batch.
Upgrading
./update.shNo variables changed, no data touched, no manual step.