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 698731FF15E for ; Mon, 24 Nov 2025 12:04:23 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 76F741FAF9; Mon, 24 Nov 2025 12:04:33 +0100 (CET) From: Nicolas Frey To: pbs-devel@lists.proxmox.com Date: Mon, 24 Nov 2025 12:04:22 +0100 Message-ID: <20251124110427.194887-3-n.frey@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251124110427.194887-1-n.frey@proxmox.com> References: <20251124110427.194887-1-n.frey@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.100 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pbs-devel] [PATCH proxmox-backup v2 1/6] datastore: add new thread settings to tuning options 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 a new field to the `DataStoreImpl` to store the verify job thread configuration from the tuning options Reviewed-by: Christian Ebner Tested-by: Christian Ebner Signed-off-by: Nicolas Frey --- Changes since v1: * make the `new` fn not pub * add docstring to `thread_settings` fn pbs-datastore/src/datastore.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/pbs-datastore/src/datastore.rs b/pbs-datastore/src/datastore.rs index 65299cca..8d3dff4d 100644 --- a/pbs-datastore/src/datastore.rs +++ b/pbs-datastore/src/datastore.rs @@ -153,6 +153,7 @@ pub struct DataStoreImpl { sync_level: DatastoreFSyncLevel, backend_config: DatastoreBackendConfig, lru_store_caching: Option, + thread_settings: DatastoreThreadSettings, } impl DataStoreImpl { @@ -169,6 +170,7 @@ impl DataStoreImpl { sync_level: Default::default(), backend_config: Default::default(), lru_store_caching: None, + thread_settings: Default::default(), }) } } @@ -263,6 +265,27 @@ impl DatastoreBackend { } } +#[derive(Clone, Default)] +/// Amount of threads to use for certain jobs in a datastore. +pub struct DatastoreThreadSettings { + /// # of threads to use to verify in verify job + pub verify_job_verify_threads: Option, + /// # of threads to use to read in verify job + pub verify_job_read_threads: Option, +} + +impl DatastoreThreadSettings { + fn new( + verify_job_verify_threads: Option, + verify_job_read_threads: Option, + ) -> Self { + Self { + verify_job_verify_threads, + verify_job_read_threads, + } + } +} + impl DataStore { // This one just panics on everything #[doc(hidden)] @@ -545,6 +568,11 @@ impl DataStore { None }; + let thread_settings = DatastoreThreadSettings::new( + tuning.default_verification_workers, + tuning.default_verification_readers, + ); + Ok(DataStoreImpl { chunk_store, gc_mutex: Mutex::new(None), @@ -555,6 +583,7 @@ impl DataStore { sync_level: tuning.sync_level.unwrap_or_default(), backend_config, lru_store_caching, + thread_settings, }) } @@ -654,6 +683,11 @@ impl DataStore { self.inner.chunk_store.base_path() } + /// Returns the thread settings for this datastore + pub fn thread_settings(&self) -> &DatastoreThreadSettings { + &self.inner.thread_settings + } + /// Returns the absolute path for a backup namespace on this datastore pub fn namespace_path(&self, ns: &BackupNamespace) -> PathBuf { let mut path = self.base_path(); -- 2.47.3 _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel