public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stefan Sterz <s.sterz@proxmox.com>,
	Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] fix #3336: api: remove backup group if the last snapshot is removed
Date: Mon, 14 Mar 2022 15:53:54 +0100	[thread overview]
Message-ID: <5ca8cb1b-f677-67d0-a4c5-052de38472b2@proxmox.com> (raw)
In-Reply-To: <f16d7d3e-3c55-a48e-6c20-564c27d49854@proxmox.com>

On 14.03.22 15:18, Stefan Sterz wrote:
> On 14.03.22 12:36, Thomas Lamprecht wrote:
>> On the other hand, we also handle creation in a similar implicit matter,
>> so maybe I'm overthinking it and just removing it would actually be more
>> consistent/expected for users.
>>
>> So, if you don't see a problem/issue with that approach and agree with
>> the last paragraph above feel free to go for deleting the owner file only.
> 
> for the most part i agree with you. i would also like to point out
> that when a group is deleted (as in, not the last snapshot, but the
> entire group at once) the owner is also implicitly removed (because
> the entire group directory is removed). so in a way, we already delete
> ownership information implicitly and the proposed solution would just
> be consistent with that behavior.

I really do not think that's comparable or would count as implicit deletion
;-)

A user triggering a whole-group removal explicitly expects that all the
associated stuff gets removed too, including owner + group directory,
there's nothing to own after that.

Iow., the difference would be like:
`rm -rf group-dir/` vs. `rm -rf group-dir/snapshot-dir`

> 
> however, i did some more digging and testing and it turns out that we
> currently assume the owner file to be present when a group directory
> exists. this affects not only sync jobs, but also verification and
> more. thus, i would need to do quite a bit of refactoring to get this
> to work and even more testing. so while this issue seemed simple
> enough, as far as i can tell our current options are:
> > 1. re-factor locking and remove the directory
> 2. re-factor how an empty group directory and the owner file is
> treated

meh, not really liking this one as it could conflict with some assumptions.

> 3. add "empty" groups to the gui

Thinking more of it with past users-behavior in mind, I'd be surprised if we
then would get the bug report for not auto-removing this in one step ^^


> 
> in light of this, taking the gui route is possibly the easiest option.
> sorry, for not being aware of this earlier.

I mean, the locking problem Wolfgang pointed out already exists currently,
meaning that we either could:

1. stay ignorant (for now) and just delete the directory
2. fixing that up-front already as it has its own merits

I don't see 1. as _that_ problematic as the deletion of the last snapshot
always has to be a manual action, (auto)pruning will never cause that.
This would allow the assumption that the user/admin already took care
of periodic backup jobs before cleaning up stuff. But yeah, definitively
has a slight sour taste. Putting this on hold and see how we can best
improve the locking w.r.t. to full backup-dir removals would IMO be the
cleanest solution.




  reply	other threads:[~2022-03-14 14:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-09 13:50 Stefan Sterz
2022-03-11 12:20 ` Thomas Lamprecht
2022-03-14  9:36   ` Wolfgang Bumiller
2022-03-14 10:19     ` Thomas Lamprecht
2022-03-14 11:13       ` Stefan Sterz
2022-03-14 11:36         ` Thomas Lamprecht
2022-03-14 14:18           ` Stefan Sterz
2022-03-14 14:53             ` Thomas Lamprecht [this message]
2022-03-14 15:19               ` Stefan Sterz
2022-03-14 17:12                 ` Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ca8cb1b-f677-67d0-a4c5-052de38472b2@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=s.sterz@proxmox.com \
    --cc=w.bumiller@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal