proxmox-backup/pbs-datastore
Shannon Sterz 23be00a42c fix #3336: datastore: remove group if the last snapshot is removed
Empty backup groups are not visible in the API or GUI. This led to a
confusing issue where users were unable to create a group because it
already existed and was still owned by another user. Resolve this
issue by removing the group if its last snapshot is removed.

Also fixes an issue where removing a group used the non-atomic
`remove_dir_all()` function when destroying a group unconditionally.
This could lead to two different threads suddenly holding a lock to
the same group. Make sure that the new locking mechanism is used,
which prevents that, before removing the group. This is also a bit
more conservative now, as it specifically removes the owner file and
group directory separately to avoid accidentally removing snapshots in
case we made an oversight.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
2025-04-02 14:42:42 +02:00
..
examples pbs-datastore: clippy fixes 2023-05-17 17:43:17 +02:00
src fix #3336: datastore: remove group if the last snapshot is removed 2025-04-02 14:42:42 +02:00
Cargo.toml fix #3935: datastore/api/backup: move datastore locking to '/run' 2025-03-26 16:21:43 +01:00