all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox{,-backup} v4 00/14] keep datastore config unlocked during long running operations
Date: Mon,  3 Aug 2026 11:07:33 +0200	[thread overview]
Message-ID: <20260803090747.265683-1-c.ebner@proxmox.com> (raw)

Currently an s3-refresh for datastores backed by s3, mount and
unmount for removalbe datastores as well as datastore creation
(independent of datastore type) run while holding the datastore
config lock for consistency.
However, this also blocks config access by all unrelated datastores.

Instead, implement per-datastore locks for maintenance-mode changes,
and rely on block unexpected maintenance-mode changes during ongoing
operations. This allows to concurrently create datastores, run s3
refresh and perform mount/unmount without blocking config access longer
than necessary.

Based on a report in the community forum: https://forum.proxmox.com/threads/183244/

Changes since version 3 (thanks @Robert for comments):
- Refactor datastore creation validation checks and combine logic into common
  helpers, so datastore config checks and operations happen independent from the
  datastore creation.
- Add MaintenanceModeLock wrapper type to clearly distinguish from datastore
  lock.
- Extend file lock inode check to also check for device number.
- Limit DATASTORE_LOCK_DIR to pub(crate).

Changes since version 2:
- Rebased onto current master

Changes since version 1 (thanks @Fabian for review):
- Heavily reworked locking helpers for s3-refresh and mount/unmount operations
- Include new maintenance type create, used to unblock concurrent datastore creation
- Refactor and code cleanup, especially with respect to chunk store scope restriction


proxmox:

Christian Ebner (1):
  pbs-api-types: add datastore create maintenance-mode type

 pbs-api-types/src/datastore.rs   | 8 ++++++++
 pbs-api-types/src/maintenance.rs | 4 ++++
 2 files changed, 12 insertions(+)


proxmox-backup:

Christian Ebner (13):
  api: config: early perform user access checks for datastore creation
  api: config: unlocked s3 bucket access check for datastore creation
  api: config: rearrange independent code block for datastore creation
  api/datastore: refactor datastore creation helper logic
  datastore: restrict chunk store scope to pbs-datastore crate
  datastore: move lock files base path constant to central location
  datastore: move file lock helper to centralized place
  datastore: add additional check for device number on lock helper
  datastore: create lockdir with correct mode for backup user access
  api/datastore: use maintenance-mode lock to protect against changes
  pbs-config: add helper to check new datastore config sections
  api: datastore: move prune job and s3 backend logic to create helper
  datastore: protect datastore creation by maintenance-mode

 pbs-config/src/datastore.rs                   |  45 +++-
 pbs-datastore/src/backup_info.rs              |  36 +--
 pbs-datastore/src/chunk_store.rs              |  22 +-
 pbs-datastore/src/datastore.rs                | 129 +++++++++-
 pbs-datastore/src/lib.rs                      |  78 +++++-
 .../src/local_datastore_lru_cache.rs          |   2 +-
 pbs-datastore/src/move_journal.rs             |   2 +-
 proxmox-backup-client/src/main.rs             |  15 +-
 src/api2/admin/datastore.rs                   |  65 ++---
 src/api2/config/datastore.rs                  | 229 ++++--------------
 src/api2/helpers.rs                           |  78 +++++-
 src/api2/node/disks/directory.rs              |  19 +-
 src/api2/node/disks/zfs.rs                    |  21 +-
 13 files changed, 438 insertions(+), 303 deletions(-)


Summary over all repositories:
  15 files changed, 450 insertions(+), 303 deletions(-)

-- 
Generated by murpp 0.11.0




             reply	other threads:[~2026-08-03  9:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  9:07 Christian Ebner [this message]
2026-08-03  9:07 ` [PATCH proxmox v4 01/14] pbs-api-types: add datastore create maintenance-mode type Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 02/14] api: config: early perform user access checks for datastore creation Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 03/14] api: config: unlocked s3 bucket access check " Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 04/14] api: config: rearrange independent code block " Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 05/14] api/datastore: refactor datastore creation helper logic Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 06/14] datastore: restrict chunk store scope to pbs-datastore crate Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 07/14] datastore: move lock files base path constant to central location Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 08/14] datastore: move file lock helper to centralized place Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 09/14] datastore: add additional check for device number on lock helper Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 10/14] datastore: create lockdir with correct mode for backup user access Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 11/14] api/datastore: use maintenance-mode lock to protect against changes Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 12/14] pbs-config: add helper to check new datastore config sections Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 13/14] api: datastore: move prune job and s3 backend logic to create helper Christian Ebner
2026-08-03  9:07 ` [PATCH proxmox-backup v4 14/14] datastore: protect datastore creation by maintenance-mode Christian Ebner

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=20260803090747.265683-1-c.ebner@proxmox.com \
    --to=c.ebner@proxmox.com \
    --cc=pbs-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal