fix(backups): detect a stale mount, not just a mounted path #177
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/stale-mount-backup-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The 8TB backup drive is unplugged
/dev/sdchas not been a block device since. Nothing has been backed up to it for two days. 59k+ btrfs read errors and counting;/backup-destreads as empty and all 14 immich snapshots throw I/O errors.The guard written for this exact scenario did not catch it
When a USB device disappears the filesystem stays mounted:
mountpoint -qreturns true,dfstill reports 7.3T/177G used, and only real I/O fails with EIO. So the guard waved every run through, rsync failed mid-transfer, and the job reportedBackoffLimitExceededwith no explanation.Verified against the live stale mount
A rare chance to test a guard against the precise condition it exists for:
mountpointonly) on the dead mountbacking device is gone (stale mount)Note on the probe: it uses
touch, not: > file.:is a POSIX special builtin, so a redirection failure makes the shell exit immediately rather than return non-zero - the abort message would never print and the exit would be accidental rather than designed. Caught by testing, not by reading.Both consumers of the drive (
immich/originals-backup,nas/3d-prints-backup) get the same guard, and both move torestartPolicy: Never-OnFailuremakes the Job controller delete the failed pod and take its logs with it, which is why two days of failures could only be seen as "no pods retained".