* [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted
@ 2025-10-14 7:55 Hannes Laimer
2025-11-11 10:54 ` Fabian Grünbichler
0 siblings, 1 reply; 2+ messages in thread
From: Hannes Laimer @ 2025-10-14 7:55 UTC (permalink / raw)
To: pbs-devel
`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>
---
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
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted
2025-10-14 7:55 [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted Hannes Laimer
@ 2025-11-11 10:54 ` Fabian Grünbichler
0 siblings, 0 replies; 2+ messages in thread
From: Fabian Grünbichler @ 2025-11-11 10:54 UTC (permalink / raw)
To: Proxmox Backup Server development discussion
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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-11 10:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-14 7:55 [pbs-devel] [PATCH proxmox-backup] proxy: avoid logging every minute that a datastore is not mounted Hannes Laimer
2025-11-11 10:54 ` Fabian Grünbichler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox