[pbs-devel] [PATCH proxmox-backup 08/11] datastore: add manifest locking
Stefan Reiter
s.reiter at proxmox.com
Thu Oct 15 09:53:21 CEST 2020
On 10/15/20 7:43 AM, Dietmar Maurer wrote:
> Note: This api does not work if you want to create a new manifest (because you
> do not have a lock)
>
>> + /// Store a given manifest. Requires a lock acquired with load_manifest_locked for safety.
>> pub fn store_manifest(
>> &self,
>> backup_dir: &BackupDir,
>> manifest: BackupManifest,
>> + _manifest_lock: ManifestLock,
>> ) -> Result<(), Error> {
Correct me if I'm wrong, but I believe we never create a manifest,
except when we upload it from the client the first time (or on pull,
which is the same thing).
That's also why I consider the flock directly on the manifest safe: The
only path we write a new manifest is on creation, where we couldn't have
possibly had a lock on it before, and whenever we change it afterward we
use this API, meaning the flock is required to be held, and thus nothing
can concurrently replace the file underneath us.
More information about the pbs-devel
mailing list