<div dir="ltr">Hi, I am seeing occasional hard to reproduce failures to lvcreate a thin LV,<br>with transaction ID mismatch errors.<br><br>The system is a self-managed compute node that uses thin LVs for base system<br>software and containers - each service has a separate thin LV as its rootfs, and<br>the system takes a fresh thin snapshot of the installed contents at every boot.<br><br>During system bring up we have two concurrent processes adding, deleting, and<br>renaming thin LVs from a single thin pool:<br><br>1 - a login script that creates a thin snapshot of a minimal rootfs for each<br>user, then launches an LXC container with that rootfs, and leaves the user in<br>bash running in that container. If any issues occur in any of that process, it<br>will lvremove the snapshot and retry several times. Although it creates a<br>container, the script itself runs as sudo root, not inside any<br>container/namespaces.<br><br>2 - a software install service that takes system services packaged as containers<br>and creates thin LVs based on the container image layer set, and then takes an<br>additional thin snapshot to be mounted for the current boot. this last snapshot<br>is multi-step, with an initial lvcreate of a temp name and a final lvrename.<br><br>Neither of these processes are in containers or on a VM with a shared volume, so<br>they should be seeing the same LVM lock files, as far as I can tell.<br><br>This overall approach has been stable for a long time, but a recent change has<br>caused these to overlap more frequently, and we are now seeing failures in<br>lvcreate with a transaction id mismatch when the install service tries to create<br>its temporary LV - here's a snippet from one such log:<br><br><br>Error: lvm lvcreate --activate=y --setactivationskip=y --ignoreactivationskip --name=tmp-extract-414e5ec83c02133eae2984ee4<br>25b22589bca058d --snapshot vg_ifc0/5e9a280e11efbc75ed8f01bdd7b58559c373b451b72921555be5c2eaf93d27b2: exit status 5:   /dev/sdh: open failed: No medium found<br>/dev/sdi: open failed: No medium found<br>/dev/sdj:ound<br>/dev/sdk: open failed: No medium found<br>/dev/sdh: open failed: No medium found<br>/dev/sdi: open failed: No medium found<br>/dev/sdj: open failed: No medium found<br>/dev/sdk: open failed: No medium fou<br>ThinDataLV-tpool (251:3) transaction_id is 147, while expected 148.<br>Failed to suspend vg_ifc0/ThinDataLV with queued messages.<br><br><br>Due to some failure recovery loops, these services are running<br>lvcreate/lvremove/lvrename (on same VG but different LVs) as often as 5 times<br>per second, which seems fast but doesn't seem like it should be a problem.<br><br>Looking through past messages to this list, it looks like previous cases were<br>due to sharing volumes between containers/vms without a common lock dir, which<br>we are not doing.<br><br>Any thoughts on how to further debug or avoid this issue?<br><br><br>I can provide the lvm metadata backup files if that would help - there are a lot<br>of them, as once it starts failing, the system retries frequently.<br><br>Ihis is on Ubuntu 20.04, with lvm 2.03.07(2)<br>(ubuntu package version 2.03.07-1ubuntu1)<br>and a custom kernel built from 5.15.68.<br><br>Thanks!<br>-mike<div class="gmail-yj6qo"></div><br class="gmail-Apple-interchange-newline"></div>