public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted
Date: Tue, 11 Nov 2025 11:54:15 +0100	[thread overview]
Message-ID: <1762858207.ukjh5bkqke.astroid@yuna.none> (raw)
In-Reply-To: <20251014075545.20528-1-h.laimer@proxmox.com>

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 <h.laimer@proxmox.com>

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


      reply	other threads:[~2025-11-11 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-14  7:55 Hannes Laimer
2025-11-11 10:54 ` Fabian Grünbichler [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1762858207.ukjh5bkqke.astroid@yuna.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal