[pbs-devel] [PATCH proxmox v4 3/3] pbs-api-types: maintenance: add new maintenance mode S3 refresh

Christian Ebner c.ebner at proxmox.com
Mon Jun 23 11:40:21 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>
---
 pbs-api-types/src/datastore.rs   | 3 +++
 pbs-api-types/src/maintenance.rs | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/pbs-api-types/src/datastore.rs b/pbs-api-types/src/datastore.rs
index 9efec432..0824eab9 100644
--- a/pbs-api-types/src/datastore.rs
+++ b/pbs-api-types/src/datastore.rs
@@ -554,6 +554,9 @@ 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