Files
restic/changelog
Rob MartinandMichael Eischer 2c9b353cbf repository: do not delete config on atomic backends during upgrade rollback (#22136)
In UpgradeRepo, if upgradeRepository fails, the error handler attempts
contingency rollback by re-uploading the original config file.

However, the contingency path unconditionally executed repo.be.Remove(ctx, h)
before calling repo.be.Save. On backends supporting atomic replacement (such
as local filesystems), a failed upgrade (e.g. out-of-disk-space or permissions
error while writing the temporary file) leaves the original, valid version 1
configuration file completely intact on disk.

Unconditionally removing the config file during rollback actively deletes
the working configuration. If the subsequent Save call also fails, the
repository is left permanently corrupted without a config file.

Condition the pre-removal on !repo.be.Properties().HasAtomicReplace, matching
the forward upgrade path in upgradeRepository. Add a unit test asserting that
aborted upgrades on atomic backends preserve the intact original configuration.

---------

Co-authored-by: Michael Eischer <michael.eischer@fau.de>
2026-11-15 18:57:01 +00:00
..
2021-08-21 12:16:04 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2018-06-10 11:29:57 +02:00
2023-12-06 13:11:55 +01:00
2023-12-06 13:11:55 +01:00
2024-03-11 14:35:12 +08:00
2023-10-27 19:48:00 +02:00
2025-09-06 21:59:11 +02:00
2024-01-08 21:33:05 +01:00