[pbs-devel] [PATCH proxmox v11 2/4] pbs-api-types: maintenance: add new maintenance mode S3 refresh

Christian Ebner c.ebner at proxmox.com
Tue Jul 22 12:10:18 CEST 2025


The new maintenance mode S3 refresh disallows any read and write
operations on the underlying datastore, but without expecting it to
be unmountable or clearing it from the internal datastore cache.

This mode is intended to be used when refreshing a datastore backed
by and S3 object store, downloading, clearing and recreating the
contents.

Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
Reviewed-by: Lukas Wagner <l.wagner at proxmox.com>
Reviewed-by: Hannes Laimer <h.laimer at proxmox.com>
Tested-by: Lukas Wagner <l.wagner at proxmox.com>
Tested-by: Hannes Laimer <h.laimer at proxmox.com>
---
changes since version 10:
 - no changes

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

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 7110a329..ee94ccad 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -567,6 +567,7 @@ impl DataStoreConfig {
             Some(MaintenanceType::Unmount) => {
                 /* used to reset it after failed unmount, or alternative for aborting unmount task */
             }
+            Some(MaintenanceType::S3Refresh) => { /* used to reset state after refresh finished */ }
             Some(MaintenanceType::Delete) => {
                 match new_type {
                     Some(MaintenanceType::Delete) => { /* allow to delete a deleted storage */ }
diff --git a/pbs-api-types/src/maintenance.rs b/pbs-api-types/src/maintenance.rs
index 3c9aa819..a516a1d9 100644
--- a/pbs-api-types/src/maintenance.rs
+++ b/pbs-api-types/src/maintenance.rs
@@ -49,6 +49,8 @@ pub enum MaintenanceType {
     Delete,
     /// The (removable) datastore is being unmounted.
     Unmount,
+    /// The S3 cache store is being refreshed.
+    S3Refresh,
 }
 serde_plain::derive_display_from_serialize!(MaintenanceType);
 serde_plain::derive_fromstr_from_deserialize!(MaintenanceType);
@@ -100,6 +102,8 @@ impl MaintenanceMode {
             bail!("datastore is being unmounted");
         } else if self.ty == MaintenanceType::Offline {
             bail!("offline maintenance mode: {}", message);
+        } else if self.ty == MaintenanceType::S3Refresh {
+            bail!("S3 refresh maintenance mode: {}", message);
         } else if self.ty == MaintenanceType::ReadOnly {
             if let Some(Operation::Write) = operation {
                 bail!("read-only maintenance mode: {}", message);
-- 
2.47.2





More information about the pbs-devel mailing list