From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9D4D5C0B4C for ; Fri, 12 Jan 2024 10:22:53 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7550A1EF18 for ; Fri, 12 Jan 2024 10:22:23 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Fri, 12 Jan 2024 10:22:22 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 43A4D447EB for ; Fri, 12 Jan 2024 10:22:22 +0100 (CET) Date: Fri, 12 Jan 2024 10:22:14 +0100 From: Fabian =?iso-8859-1?q?Gr=FCnbichler?= To: Proxmox VE development discussion References: <20240111165826.804669-1-f.weber@proxmox.com> In-Reply-To: <20240111165826.804669-1-f.weber@proxmox.com> MIME-Version: 1.0 User-Agent: astroid/0.16.0 (https://github.com/astroidmail/astroid) Message-Id: <1705047462.e8upimiin2.astroid@yuna.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-LEVEL: Spam detection results: 0 AWL 0.065 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 SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [lvmplugin.pm, proxmox.com, sourceware.org] Subject: Re: [pve-devel] [PATCH storage] lvm: avoid warning due to human-readable text in vgs output 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: , X-List-Received-Date: Fri, 12 Jan 2024 09:22:53 -0000 On January 11, 2024 5:58 pm, Friedrich Weber wrote: > If the metadata archive under /etc/lvm/archive for a particular VG has > a lot of files or is overly large, `vgs` occasionally prints a message > to stdout [1]. The LVM plugin tries to parse this message and thus > produces the following confusing warnings in the output of `pvesm > status` or the journal (via pvestatd): >=20 > Use of uninitialized value $size in int at [...]/LVMPlugin.pm line 133 > Use of uninitialized value $free in int at [...]/LVMPlugin.pm line 133 > Use of uninitialized value $lvcount in int [...]/LVMPlugin.pm line 133 >=20 > Reported in enterprise support where LVM picked up on VGs on VM disks > (due to a missing KRBD device filter in the LVM config), and since > several VM disks had VGs with the same name, LVM quickly produced a > lot of files in /etc/lvm/archive. >=20 > Reproducible as follows with a VG named `spam`: >=20 > for i in $(seq 8192); > do vgrename spam spam2; vgrename spam2 spam; done > rm /etc/lvm/backup/spam; vgs -o vg_name >=20 > Output (linebreak for readability): >=20 > Consider pruning spam VG archive with more then 8 MiB in 8268\n > files (check archiving is needed in lvm.conf). > VG > spam >=20 > [1] https://sourceware.org/git/?p=3Dlvm2.git;a=3Dblob;f=3Dlib/format_text= /archive.c;h=3D5acf0c04a;hb=3D38e0c7a1#l222 >=20 > Signed-off-by: Friedrich Weber > --- > src/PVE/Storage/LVMPlugin.pm | 3 +++ > 1 file changed, 3 insertions(+) >=20 > diff --git a/src/PVE/Storage/LVMPlugin.pm b/src/PVE/Storage/LVMPlugin.pm > index 4b951e7..557d602 100644 > --- a/src/PVE/Storage/LVMPlugin.pm > +++ b/src/PVE/Storage/LVMPlugin.pm > @@ -130,6 +130,9 @@ sub lvm_vgs { > =20 > my ($name, $size, $free, $lvcount, $pvname, $pvsize, $pvfree) =3D s= plit (':', $line); > =20 > + # skip human-readable messages that vgs occasionally prints to stdo= ut > + return if !defined($size); > + we might want to either log this message (like anything printed to STDERR), so that the admin at least can notice something weird is going on, or pass '-qq' to switch `vgs` into silent mode where no such messages will be printed - although for the latter variant we might want to check what (else) gets suppressed ("log_print_unless_silent").. AFAICT this message only gets printed if the archives grew very big, and the backup file does not exist? at least for me using your reproducer, it's only printed once, and I have to rename rename rm again afterwards to get it to show up again, which would mean it's not too bad to log it (as long as it doesn't confuse our code). the `lvmscan` endpoint also picks up the line btw, which means it ends up being included in the "VG" selector on the web UI when adding an LVM storage ;) > $vgs->{$name} //=3D { > size =3D> int ($size), > free =3D> int ($free), > --=20 > 2.39.2 >=20 >=20 >=20 > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel >=20 >=20 >=20