[pbs-devel] [PATCH v2 proxmox-backup 1/4] gc: avoid race between phase1 and forget/prune

Dietmar Maurer dietmar at proxmox.com
Fri Oct 16 08:26:15 CEST 2020


> ...by saving all forgotten chunks into a HashSet when we detect a GC

forgotten chunks? I think you store index file names in that hash...

> phase1 currently running. If GC then hits a NotFound, it can check if
> the snapshot was simply forgotten behind its back, or if an actual error
> occurred and it needs to abort (since it might delete still referenced
> chunks, if the error is transient and the index file is still there).

Thought more about this, and this "transient" error model makes no sense too me.
You can get such "transient" errors during list_images(), so this approach does not really
provide any protection for that.

So for now, I applied a simpler version which simply ignores vanished files.

We can still apply further safety guards if it turns out we need them ...

> We have to attach the error message in {fixed,dynamic}_index via the
> .context() method, otherwise the original std::io::Error gets lost and
> we can't check for NotFound.

above comment is obsolete for v2





More information about the pbs-devel mailing list