* [pbs-devel] [PATCH proxmox-backup v2] fix #4823: datastore: ignore vanished files when walking directory
@ 2023-09-08 12:56 Gabriel Goller
2023-09-18 14:44 ` [pbs-devel] applied: " Thomas Lamprecht
0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Goller @ 2023-09-08 12:56 UTC (permalink / raw)
To: pbs-devel
When walking through a datastore on a GC run, it can
happen that the snapshot is deleted, and then walked over.
For example:
- read dir entry for group
- walk entries (snapshots)
- snapshot X is removed/pruned
- walking reaches snapshot X, but ENOENT
Previously we bailed here, now we just ignore it.
Backups that are just created (and a atomic rename from
tmpdir happens, which might triggers a ENOENT error) are
not a problem here, the GC handles them separately.
Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
update v2:
- rebased, added log message
pbs-datastore/src/datastore.rs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs
index d0c2b90a..8a417bfa 100644
--- a/pbs-datastore/src/datastore.rs
+++ b/pbs-datastore/src/datastore.rs
@@ -880,6 +880,9 @@ impl DataStore {
return Ok(());
}
bail!("cannot continue garbage-collection safely, permission denied on: {path:?}");
+ } else if inner.kind() == io::ErrorKind::NotFound {
+ log::info!("ignoring vanished file: {path:?}");
+ return Ok(());
} else {
bail!("unexpected error on datastore traversal: {inner} - {path:?}");
}
--
2.39.2
^ permalink raw reply [flat|nested] 2+ messages in thread
* [pbs-devel] applied: [PATCH proxmox-backup v2] fix #4823: datastore: ignore vanished files when walking directory
2023-09-08 12:56 [pbs-devel] [PATCH proxmox-backup v2] fix #4823: datastore: ignore vanished files when walking directory Gabriel Goller
@ 2023-09-18 14:44 ` Thomas Lamprecht
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2023-09-18 14:44 UTC (permalink / raw)
To: Proxmox Backup Server development discussion, Gabriel Goller
Am 08/09/2023 um 14:56 schrieb Gabriel Goller:
> When walking through a datastore on a GC run, it can
> happen that the snapshot is deleted, and then walked over.
> For example:
> - read dir entry for group
> - walk entries (snapshots)
> - snapshot X is removed/pruned
> - walking reaches snapshot X, but ENOENT
> Previously we bailed here, now we just ignore it.
> Backups that are just created (and a atomic rename from
> tmpdir happens, which might triggers a ENOENT error) are
> not a problem here, the GC handles them separately.
>
> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
> ---
>
> update v2:
> - rebased, added log message
>
> pbs-datastore/src/datastore.rs | 3 +++
> 1 file changed, 3 insertions(+)
>
>
applied, thanks!
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-09-18 14:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-08 12:56 [pbs-devel] [PATCH proxmox-backup v2] fix #4823: datastore: ignore vanished files when walking directory Gabriel Goller
2023-09-18 14:44 ` [pbs-devel] applied: " Thomas Lamprecht
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox