From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id E6D681FF09C for ; Mon, 19 Oct 2026 18:04:29 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 7839821638; Mon, 19 Oct 2026 18:04:18 +0200 (CEST) From: Shan Shaji To: pbs-devel@lists.proxmox.com Subject: [PATCH proxmox-backup 5/9] fix #7908: datastore: api: add option to create zero-byte chunk markers Date: Mon, 19 Oct 2026 18:03:55 +0200 Message-ID: <20261019160359.20851-6-s.shaji@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261019160359.20851-1-s.shaji@proxmox.com> References: <20261019160359.20851-1-s.shaji@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1792425854701 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.407 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: TAVT3EMHCL5664T6NYGYSOKWN2INRTJ7 X-Message-ID-Hash: TAVT3EMHCL5664T6NYGYSOKWN2INRTJ7 X-MailFrom: s.shaji@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Expose the `rebuild-chunk-markers` option inside the `/api2/config/ datastore` endpoint. This allows users to optionally create empty, zero-byte chunk markers during reconstruction. Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=7908 Signed-off-by: Shan Shaji --- src/api2/config/datastore.rs | 15 ++++++++++++++- src/api2/node/disks/directory.rs | 1 + src/api2/node/disks/zfs.rs | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/api2/config/datastore.rs b/src/api2/config/datastore.rs index a390bbd6b..b3832bae5 100644 --- a/src/api2/config/datastore.rs +++ b/src/api2/config/datastore.rs @@ -95,12 +95,13 @@ impl Drop for UnmountGuard { pub(crate) fn do_create_datastore( lock: BackupLockGuard, - _worker: &dyn WorkerTaskContext, + worker: &dyn WorkerTaskContext, backend_type: DatastoreBackendType, mut datastore: DataStoreConfig, prune_job_config: Option, reuse_datastore: bool, overwrite_in_use: bool, + rebuild_chunk_markers: bool, ) -> Result<(), Error> { // always start out in maintenance-mode create, so access can be blocked during creation // without needing to hold the config lock, only the maintenance-mode lock. @@ -134,6 +135,10 @@ pub(crate) fn do_create_datastore( let datastore_instance = DataStore::lookup_datastore(lookup_with(&datastore.name, Operation::Lookup))?; proxmox_async::runtime::block_on(datastore_instance.s3_refresh())?; + + if rebuild_chunk_markers { + datastore_instance.create_empty_s3_chunk_markers(worker)?; + } } unset_maintenance_mode(Some(maintenance_mode_lock), &datastore.name, current_type)?; @@ -161,6 +166,12 @@ pub(crate) fn do_create_datastore( default: false, description: "Overwrite in use marker (S3 backed datastores only)." }, + "rebuild-chunk-markers": { + type: Boolean, + optional: true, + default: false, + description: "Create zero-byte chunk markers (S3 backed datastores only)" + } }, }, access: { @@ -173,6 +184,7 @@ pub fn create_datastore( config: DataStoreConfig, reuse_datastore: bool, overwrite_in_use: bool, + rebuild_chunk_markers: bool, rpcenv: &mut dyn RpcEnvironment, ) -> Result { let auth_id: Authid = rpcenv.get_auth_id().unwrap().parse()?; @@ -239,6 +251,7 @@ pub fn create_datastore( prune_job_config, reuse_datastore, overwrite_in_use, + rebuild_chunk_markers, ) }, ) diff --git a/src/api2/node/disks/directory.rs b/src/api2/node/disks/directory.rs index 61e4f9df6..81b6fe36e 100644 --- a/src/api2/node/disks/directory.rs +++ b/src/api2/node/disks/directory.rs @@ -258,6 +258,7 @@ pub fn create_datastore_disk( None, false, false, + false, )?; } diff --git a/src/api2/node/disks/zfs.rs b/src/api2/node/disks/zfs.rs index b5a0dbfe6..f8c905ccf 100644 --- a/src/api2/node/disks/zfs.rs +++ b/src/api2/node/disks/zfs.rs @@ -318,6 +318,7 @@ pub fn create_zpool( None, false, false, + false, )?; } -- 2.47.3