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 C730E1FF167 for ; Wed, 31 Jul 2024 13:10:57 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 3E684C014; Wed, 31 Jul 2024 13:10:59 +0200 (CEST) Message-ID: <25126e09-edd4-4c75-ab62-f16b793233a3@proxmox.com> Date: Wed, 31 Jul 2024 13:10:21 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Fiona Ebner To: Proxmox VE development discussion References: Content-Language: en-US In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL -0.060 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 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH manager] ui: dc summary: fix calculation of shared storage size X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Cc: Igor Thaller Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Am 30.07.24 um 15:44 schrieb Igor Thaller via pve-devel: > The issue is related to the 'Summary' tab under 'Datacenter' inside a > cluster. To get a steady reading of the storage size data, the frontend > requests the '/api2/json/cluster/resources' every three seconds to > retrieve the necessary data to calculate the used and total storage > size. > > The problem occurs when a shared storage is defined and a node goes > offline. As the node is not online, it cannot report the shared storage > size (both used and total) back to the other nodes. The order of the > JSON response is not always the same, so it is possible that the offline > node will appear first. Consequently, the front-end will display the > wrong total and used storage. This is because the shared storage data > has both the maximum disk size and the used disk set to zero when the > node is offline. This causes the total and used space data to be > calculated and displayed incorrectly, leading to fluctuations in the > displayed percentage of used disk space. > > To fix this, a conditional check to skip the storage report if its > status is 'unknown' and it is shared was added. This prevents the > unreliable data from being processed. > Nit: "and it is shared was added" could be improved language-wise While the issue is seen with shared storages, would there be a downside of skipping non-shared storages with status "unknown" too? From a quick look, it seems that disk/maxdisk not being set does not depend on the storage being shared, so I'd rather skip the addition with unset values too. > To test these changes, adjust the 'max_requests' variable in the Perl > script located at '/usr/share/perl5/PVE/Service/pveproxy.pm' to increase > the likelihood of the error to occur. This makes the storage size > fluctuations more frequent. Then compare the storage results (both used > and total sizes) before and after implementing the fix. > > Note: Be aware that it takes around one minute for the spike to happen. > IMHO this part should not go into the commit message, but be mentioned below the "---" > Reported-by: Friedrich Weber > Signed-off-by: Igor Thaller > --- > www/manager6/dc/Summary.js | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js > index efb44dae..9b8f3280 100644 > --- a/www/manager6/dc/Summary.js > +++ b/www/manager6/dc/Summary.js > @@ -170,6 +170,11 @@ Ext.define('PVE.dc.Summary', { > } else if (countedStorage[sid]) { > break; > } > + > + if (data.status === "unknown" && data.shared) { > + break; > + } > + > used += data.disk; > total += data.maxdisk; > countedStorage[sid] = true; > -- > 2.39.2 > > _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel