[pbs-devel] [PATCH v2 proxmox{, -backup} 0/2] Move ProcessLocker to tmpfs

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Dec 6 15:14:20 CET 2023


> Gabriel Goller <g.goller at proxmox.com> hat am 06.12.2023 14:56 CET geschrieben:
> On 12/6/23 14:41, Fabian Grünbichler wrote:
> >>
> >> Gabriel Goller <g.goller at proxmox.com> hat am 06.12.2023 14:28 CET 
> >> geschrieben: This moves the `ProcessLocker`'s `.lock` file to 
> >> `/run/proxmox-backup/locks` (tmpfs). The first patch only converts 
> >> all the `F_SETLK` flags to `F_OFD_SETLK` flags. This changes normal 
> >> locks, which are based on the process, to locks based on an open file 
> >> descriptor. This actually doesn't change anything, because we use 
> >> mutexes, so the lock is already thread-safe. It would be cleaner 
> >> though and would safe us from weird quirks like closing the lock-file 
> >> which would drop all the locks when using the POSIX `F_SETLK`. See 
> >> more here [0].
> >>
> > this might be moot, since most likely both patches go in at the same 
> > time, is this change reload/upgrade-compatible? i.e., if an old 
> > proxmox-backup(-proxy) process is (still) running that has the lock 
> > open with F_SETLK, and the new one obtains it using F_OFD_SETLK, is 
> > the behaviour still correct? (the other direction might be interesting 
> > too, but can only happen on an unsupported downgrade)
> >
> Just spoke with Stefan Sterz about this and we will probably 
> apply/release this with a major version bump (kernel update), so that 
> the user
> is forced to reboot the system (same as with his tmpfs locking series).
> I don't think there is another way, because the lockfiles get moved to 
> another dir. Although F_SETLK and F_OFD_SETLK should be compatible,
> so having one process use F_SETLK and another F_OFD_SETLK *should* still 
> work (don't take my word for it though).

that doesn't really help though, unless we also add machinery to detect the missing reboot and block any process-locker-requiring stuff in the new process until it has happened? or we make "set all datastores to read-only or offline" a requirement for upgrading from 3 to 4, instead of optional like for 2 to 3[0]. otherwise even just the time between "postinst of PBS package is called" to "upgrade of whole system is fully done" can be big enough to cause a problem..

0: https://pbs.proxmox.com/wiki/index.php/Upgrade_from_2_to_3#Optional:_Enable_Maintenance_Mode




More information about the pbs-devel mailing list