From 87f666d2a25c23718de68806d93463f2173649b1 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 20 Apr 2024 02:03:53 +0300 Subject: [PATCH] Filter out OSDs reweighted to 0 --- mon/mon.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mon/mon.js b/mon/mon.js index e0e338d4..53d2cdd5 100644 --- a/mon/mon.js +++ b/mon/mon.js @@ -881,13 +881,13 @@ class Mon { const stat = this.state.osd.stats[osd_num]; const osd_cfg = this.state.config.osd[osd_num]; - if (stat && stat.size && (this.state.osd.state[osd_num] || Number(stat.time) >= down_time || + let reweight = osd_cfg == null ? 1 : Number(osd_cfg.reweight); + if (reweight < 0 || isNaN(reweight)) + reweight = 1; + if (stat && stat.size && reweight && (this.state.osd.state[osd_num] || Number(stat.time) >= down_time || osd_cfg && osd_cfg.noout)) { // Numeric IDs are reserved for OSDs - let reweight = osd_cfg == null ? 1 : Number(osd_cfg.reweight); - if (reweight < 0 || isNaN(reweight)) - reweight = 1; if (this.state.osd.state[osd_num] && reweight > 0) { // React to down OSDs immediately