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 8CCCF1FF17A for ; Tue, 11 Nov 2025 11:54:07 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 38FFD66E2; Tue, 11 Nov 2025 11:54:53 +0100 (CET) Date: Tue, 11 Nov 2025 11:54:15 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox Backup Server development discussion References: <20251014075545.20528-1-h.laimer@proxmox.com> In-Reply-To: <20251014075545.20528-1-h.laimer@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.17.0 (https://github.com/astroidmail/astroid) Message-Id: <1762858207.ukjh5bkqke.astroid@yuna.none> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1762858435056 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.047 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: Re: [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted 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" On October 14, 2025 9:55 am, Hannes Laimer wrote: > `lookup_datastore` fails if a removable datastore is not mounted, > which is fine. But for job scheduling which happens every minute > we don't want the lookup to fail and fill the syslogs with unnecesarry > entries, so we check the mount status before we do the lookup to avoid > that. > > Reported-by: https://forum.proxmox.com/threads/sicherung-auf-usb.167291/post-808237 > Signed-off-by: Hannes Laimer couldn't we also rework this to first check if GC should be started in the first place according to the schedule, and move the lookup and garbage_collection_running call further below? that would already reduce the amount of warnings a lot, and warning if the mounted status and GC schedule don't line up and we are missing GC executions that should take place seems valid? though whether warning every minute makes sense is a different matter (as is whether doing time-based GC scheduling for removable datastores makes sense) > --- > src/bin/proxmox-backup-proxy.rs | 12 +++++++++--- > 1 file changed, 9 insertions(+), 3 deletions(-) > > diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs > index cfd93f92..762b5736 100644 > --- a/src/bin/proxmox-backup-proxy.rs > +++ b/src/bin/proxmox-backup-proxy.rs > @@ -22,7 +22,7 @@ use proxmox_router::{RpcEnvironment, RpcEnvironmentType}; > use proxmox_sys::fs::CreateOptions; > use proxmox_sys::logrotate::LogRotate; > > -use pbs_datastore::DataStore; > +use pbs_datastore::{DataStore, get_datastore_mount_status}; > > use proxmox_rest_server::{ > cleanup_old_tasks, cookie_from_header, rotate_task_log_archive, ApiConfig, Redirector, > @@ -516,7 +516,7 @@ async fn schedule_datastore_garbage_collection() { > } > }; > > - let event_str = match store_config.gc_schedule { > + let event_str = match store_config.gc_schedule.as_ref() { > Some(event_str) => event_str, > None => continue, > }; > @@ -530,6 +530,12 @@ async fn schedule_datastore_garbage_collection() { > }; > > { > + if let Some(false) = get_datastore_mount_status(&store_config) { > + // lookup_datastore would fail correctly, but we don't want log entries every > + // minute for a not mounted removable datastore > + continue; > + } > + > // limit datastore scope due to Op::Lookup > let datastore = match DataStore::lookup_datastore(&store, Some(Operation::Lookup)) { > Ok(datastore) => datastore, > @@ -588,7 +594,7 @@ async fn schedule_datastore_garbage_collection() { > job, > datastore, > auth_id, > - Some(event_str), > + Some(event_str.into()), > false, > ) { > eprintln!("unable to start garbage collection job on datastore {store} - {err:#}"); > -- > 2.47.3 > > > > _______________________________________________ > pbs-devel mailing list > pbs-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel > > > _______________________________________________ pbs-devel mailing list pbs-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel