]> git.proxmox.com Git - proxmox-backup.git/commit
gc: treat .bad files like regular chunks
authorStefan Reiter <s.reiter@proxmox.com>
Thu, 12 Nov 2020 14:50:08 +0000 (15:50 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 18 Nov 2020 13:04:49 +0000 (14:04 +0100)
commitfd1925647069ac1d49758e801b379e5c1fb196bf
tree068943e43967d6c9ce1a587641601e66390acaee
parent1ed022576cef92d68e97d30bea3e91da8dc14085
gc: treat .bad files like regular chunks

Simplify the phase 2 code by treating .bad files just like regular
chunks, with the exception of stat logging.

To facilitate, we need to touch .bad files in phase 1. We only do this
under the condition that 1) the original chunk is missing (as before),
and 2) the original chunk is still referenced somewhere (since the code
lives in the error handler for a failed chunk touch, it only gets called
for chunks we expect to be there, i.e. ones that are referenced).

Untouched they will then be cleaned up after 24 hours (or after the last
longer-running task finishes).

Reason 2) is also a fix for .bad files not being cleaned up at all if
the original is no longer referenced anywhere (e.g. a user deleting all
snapshots after seeing some corrupt chunks appear).

cond_touch_path is introduced to touch arbitrary paths in the chunk
store with the same logic as touching chunks.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
src/backup/chunk_store.rs
src/backup/datastore.rs