public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox-backup] proxy: rrd: skip update disk stats for offline datastores
@ 2022-05-04  5:49 Hannes Laimer
  2022-05-12  9:53 ` [pbs-devel] applied: " Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Hannes Laimer @ 2022-05-04  5:49 UTC (permalink / raw)
  To: pbs-devel

RDD update did not use lookup_datastore() and therefore bypassed
the maintenance mode checks. This adds the needed check directly.

Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
---
 src/bin/proxmox-backup-proxy.rs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/bin/proxmox-backup-proxy.rs b/src/bin/proxmox-backup-proxy.rs
index 6a305b7c..c71d0009 100644
--- a/src/bin/proxmox-backup-proxy.rs
+++ b/src/bin/proxmox-backup-proxy.rs
@@ -1071,6 +1071,12 @@ fn generate_host_stats_sync() {
                 .unwrap_or_default();
 
             for config in datastore_list {
+                if config
+                    .get_maintenance_mode()
+                    .map_or(false, |mode| mode.check(Some(Operation::Read)).is_err())
+                {
+                    continue;
+                }
                 let rrd_prefix = format!("datastore/{}", config.name);
                 let path = std::path::Path::new(&config.path);
                 gather_disk_stats(disk_manager.clone(), path, &rrd_prefix);
-- 
2.30.2





^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] applied: [PATCH proxmox-backup] proxy: rrd: skip update disk stats for offline datastores
  2022-05-04  5:49 [pbs-devel] [PATCH proxmox-backup] proxy: rrd: skip update disk stats for offline datastores Hannes Laimer
@ 2022-05-12  9:53 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2022-05-12  9:53 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Hannes Laimer

Am 5/4/22 um 07:49 schrieb Hannes Laimer:
> RDD update did not use lookup_datastore() and therefore bypassed
> the maintenance mode checks. This adds the needed check directly.
> 
> Signed-off-by: Hannes Laimer <h.laimer@proxmox.com>
> ---
>  src/bin/proxmox-backup-proxy.rs | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
>

applied, thanks!

But there was a similar issue in the schedule_datastore_garbage_collection fn,
which tried to look up the Datastore with a Write operation at the very start,
before even checking if GC for that store is scheduled at all and if it would be
pending now, and the actual problematic check if GC is already running (which needs
a datastore instance, so just moving the lookup code downward couldn't be the single
solution).

For that I added a new Lookup operation in a limited scope, and then open the
datastore with the Write op only directly before actually wanting to start GC,
at which point a log entry is ok.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-12  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-04  5:49 [pbs-devel] [PATCH proxmox-backup] proxy: rrd: skip update disk stats for offline datastores Hannes Laimer
2022-05-12  9:53 ` [pbs-devel] applied: " Thomas Lamprecht

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