From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 383501FF163 for ; Thu, 21 Nov 2024 14:35:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 359381E62D; Thu, 21 Nov 2024 14:35:46 +0100 (CET) From: Gabriel Goller To: pbs-devel@lists.proxmox.com Date: Thu, 21 Nov 2024 14:35:08 +0100 Message-Id: <20241121133509.289419-4-g.goller@proxmox.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20241121133509.289419-1-g.goller@proxmox.com> References: <20241121133509.289419-1-g.goller@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.039 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: [pbs-devel] [PATCH proxmox-backup v4 3/4] fix #3786: ui/cli: add resync-corrupt option on sync-jobs X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox Backup Server development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pbs-devel-bounces@lists.proxmox.com Sender: "pbs-devel" Add the `resync-corrupt` option to the ui and the `proxmox-backup-manager` cli. It is listed in the `Advanced` section, because it slows the sync-job down and is useless if no verification job was run beforehand. Originally-by: Shannon Sterz Signed-off-by: Gabriel Goller --- src/bin/proxmox-backup-manager.rs | 16 ++++++++++++++-- www/window/SyncJobEdit.js | 11 +++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/bin/proxmox-backup-manager.rs b/src/bin/proxmox-backup-manager.rs index d887dc1d50a1..02ca0d028225 100644 --- a/src/bin/proxmox-backup-manager.rs +++ b/src/bin/proxmox-backup-manager.rs @@ -14,8 +14,8 @@ use pbs_api_types::percent_encoding::percent_encode_component; use pbs_api_types::{ BackupNamespace, GroupFilter, RateLimitConfig, SyncDirection, SyncJobConfig, DATASTORE_SCHEMA, GROUP_FILTER_LIST_SCHEMA, IGNORE_VERIFIED_BACKUPS_SCHEMA, NS_MAX_DEPTH_SCHEMA, - REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, TRANSFER_LAST_SCHEMA, UPID_SCHEMA, - VERIFICATION_OUTDATED_AFTER_SCHEMA, + REMOTE_ID_SCHEMA, REMOVE_VANISHED_BACKUPS_SCHEMA, RESYNC_CORRUPT_SCHEMA, TRANSFER_LAST_SCHEMA, + UPID_SCHEMA, VERIFICATION_OUTDATED_AFTER_SCHEMA, }; use pbs_client::{display_task_log, view_task_result}; use pbs_config::sync; @@ -307,6 +307,7 @@ async fn sync_datastore( group_filter: Option>, limit: RateLimitConfig, transfer_last: Option, + resync_corrupt: Option, param: Value, sync_direction: SyncDirection, ) -> Result { @@ -343,6 +344,10 @@ async fn sync_datastore( args["transfer-last"] = json!(transfer_last) } + if let Some(resync) = resync_corrupt { + args["resync-corrupt"] = Value::from(resync); + } + let mut limit_json = json!(limit); let limit_map = limit_json .as_object_mut() @@ -405,6 +410,10 @@ async fn sync_datastore( schema: TRANSFER_LAST_SCHEMA, optional: true, }, + "resync-corrupt": { + schema: RESYNC_CORRUPT_SCHEMA, + optional: true, + }, } } )] @@ -421,6 +430,7 @@ async fn pull_datastore( group_filter: Option>, limit: RateLimitConfig, transfer_last: Option, + resync_corrupt: Option, param: Value, ) -> Result { sync_datastore( @@ -434,6 +444,7 @@ async fn pull_datastore( group_filter, limit, transfer_last, + resync_corrupt, param, SyncDirection::Pull, ) @@ -513,6 +524,7 @@ async fn push_datastore( group_filter, limit, transfer_last, + None, param, SyncDirection::Push, ) diff --git a/www/window/SyncJobEdit.js b/www/window/SyncJobEdit.js index 0e648e7b3e50..03f61bee6494 100644 --- a/www/window/SyncJobEdit.js +++ b/www/window/SyncJobEdit.js @@ -358,6 +358,17 @@ Ext.define('PBS.window.SyncJobEdit', { deleteEmpty: '{!isCreate}', }, }, + { + fieldLabel: gettext('Resync corrupt snapshots'), + xtype: 'proxmoxcheckbox', + name: 'resync-corrupt', + autoEl: { + tag: 'div', + 'data-qtip': gettext('Re-sync snapshots, whose verfification failed.'), + }, + uncheckedValue: false, + value: false, + }, ], }, { -- 2.39.5 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel