From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 6CECD1FF0B3 for ; Wed, 11 Nov 2026 10:22:37 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 9F0102160A; Wed, 11 Nov 2026 10:22:34 +0100 (CET) From: Maximiliano Sandoval To: Thomas Lamprecht Subject: Re: [PATCH storage] lvm: bound storage status commands In-Reply-To: <20261111015217.941220-1-t.lamprecht@proxmox.com> (Thomas Lamprecht's message of "Wed, 11 Nov 2026 02:50:31 +0100") References: <20261111015217.941220-1-t.lamprecht@proxmox.com> User-Agent: mu4e 1.12.9; emacs 30.1 Date: Wed, 11 Nov 2026 10:22:28 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794388949098 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.730 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 4ZHTJ7C5E2PUGYVX3GDT6QEZX7GBZTYX X-Message-ID-Hash: 4ZHTJ7C5E2PUGYVX3GDT6QEZX7GBZTYX X-MailFrom: m.sandoval@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: A very small comment below. Thomas Lamprecht writes: > A status command stuck in uninterruptible device I/O blocks storage > status indefinitely: run_command waits for its child, and SIGKILL does > not end such a command. That happens for example when all paths of a > multipath map that queues I/O are gone. pvestatd and API calls that Only if queue_if_no_path is enabled or no_path_retry is set to queue for the device. One of the difficulties is that is not easy to detect the value of either configuration at runtime. e.g. it could come from /etc/multipath.conf, /etc/multipath/conf.d/*, from the defaults [1], etc. On top of that, each location contains global values and device specific rules and it is not always clear what takes priority over what. [1] https://github.com/opensvc/multipath-tools/blob/0.11.1/libmultipath/hwtable.c > query the storage status then hang with it. > > Run the vgs, lvs and pvscan calls of a status pass through a killable > Perl child, with a 15-second limit including lock acquisition. The > command inherits a lock and keeps it until it really exits, so later > passes cannot pile up commands on the same failed device. While a > command is stuck, LVM storages are reported inactive; other storages > are not affected. > > Signed-off-by: Thomas Lamprecht > --- > > This was part of v3 of the SAN series [0], with a new run_command() mode > and a hand-over across the daemon re-exec. It is independent of that > series and could be remodelled so that the existing > run_fork_with_timeout() is enough, and nothing changes for callers > outside of a status pass. > > Tested on a nested cluster with a shared volume group on a two-path > iSCSI LUN whose map queues forever, with stock libpve-common-perl: with > all paths cut for three minutes, one killed vgs stays in state D as a > child of init and holds the lock, pvestatd keeps running, and the > storage status API keeps answering with the LVM storages inactive. A > pass spends 14 seconds waiting for the lock; the rest of the 27 seconds > per API call there are the portal checks of the unreachable iSCSI > target, as before. Everything is active again at the first check ten > seconds after the paths return. > > Known limits: > > - The status commands of all callers on a node (pvestatd, API workers, > pvesm) now run one after the other. A caller whose wait for the lock > plus its own command exceed 14 seconds reports the LVM storages > inactive for that pass. vgs takes 0.05 seconds on the test nodes > with 36 PVs, so this needs very slow listings and several callers at > once. > - Activating an inactive thin pool (lvchange) is not bounded, as on > master: killing an activation midway would be worse. > - A SIGTERM that arrives while run_fork_with_timeout() waits is > consumed there, as for the df fork of directory storages today, where > the window is much shorter. Stopping pvestatd during that wait > therefore ends with the SIGKILL fallback of the stop command after > five seconds. That is for run_fork_with_timeout() to fix. > - The stuck command stays in the control group of the service that > started it. If that is pvestatd, systemctl stop and restart wait > for the command or for systemd's stop timeout (68 seconds in the > test, until the target's default queueing gave up); a reload > re-executes the daemon and does not wait. On master the daemon > hangs with the command in that situation. > > [0]: https://lore.proxmox.com/pve-devel/20261105233336.2178064-1-t.lamprecht@proxmox.com/ > > [...] Despite the limitations above this is an improvement over the current situation where once all paths are offline (with no_path_retry=queue) all pvedaemon workers would get stuck after a couple of seconds and, e.g. it would not be possible to login to the web UI. Tested-by: Maximiliano Sandoval -- Maximiliano