[pbs-devel] [PATCH proxmox-backup v5 02/22] datastore: add cache entry flag for droping it after last task

Thomas Lamprecht t.lamprecht at proxmox.com
Thu Apr 18 07:12:45 CEST 2024


Am 17/04/2024 um 14:23 schrieb Hannes Laimer:
> ... this allows us to keep track of which datastores are in the
> process of being removed. Also, let's us avoid reading the config on
> every drop of a DataStore reference.

can't we re-use the offline maintenance mode instead?

I.e., if a user wants to safely unplug a datastore they should
use the unmount API which would then spawn a task that sets the
offline maintenance mode, then polls that datastore until the
maintenance mode is reached, then fssyncs and unmounts the datastore
cleanly and removes the offline maintenance mode again.

This way we do not need any new mechanisms and have sane handling
with nice UX.

The case where the media of a datastore is just unplugged in an unsafe
way would be still covered by your new cheap checks, but that should be
seen as safety net only.

And with removing the maintenance mdoe at the end we do not have the
hacky situation where some udev hook would trigger a config write.

If something happens in-between unplugging, like a power cut, the
user would also notice and could then unlock the maintenance manually
after investigating.




More information about the pbs-devel mailing list