Description of problem: thin pool data can use a cache LV, but not a writecache LV. I don't know of a technical reason why this should not be allowed, but enabling it would require testing. # lvs test LV VG Attr LSize Pool Origin main test Cwi---C--- 1.00g [fast_cvol] [main_wcorig] # lvconvert --type thin-pool test/main Command on LV test/main does not accept LV type writecache. Command not permitted on LV test/main. # lvs test LV VG Attr LSize Pool Origin main test Cwi---C--- 1.00g [fast_cvol] [main_corig] # lvconvert --type thin-pool test/main Thin pool volume with chunk size 64.00 KiB can address at most 15.81 TiB of data. WARNING: Converting test/main to thin pool's data volume with metadata wiping. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Do you really want to convert test/main? [y/n]: y Converted test/main to thin pool. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
When writecache (or cache) is used for thin data, the thin pool cannot be extended. This seems to make the combination of little use in practice, so I'm setting aside work on this.
the test lvextend-caches-on-thindata.sh covers both writecache and cache.
Marking Verified:Tested in the current rpms. kernel-4.18.0-348.4.el8.kpq0 BUILT: Wed Oct 27 15:00:32 CDT 2021 lvm2-2.03.14-1.el8 BUILT: Wed Oct 20 10:18:17 CDT 2021 lvm2-libs-2.03.14-1.el8 BUILT: Wed Oct 20 10:18:17 CDT 2021 SCENARIO - [display_thin_snap] Create a snapshot and then display it a couple ways Making pool volume lvcreate --yes --zero y -L 4M -n meta snapper_thinp /dev/sdb1 /dev/sdd1 lvcreate --yes --zero y -L 1G -n POOL snapper_thinp /dev/sdb1 /dev/sdd1 lvcreate --yes -L 400M -n wcpool snapper_thinp /dev/sdc1 lvchange -an snapper_thinp/wcpool Converting *writecached* volume to thin pool data device lvconvert --yes --type writecache --cachevol snapper_thinp/wcpool snapper_thinp/POOL WARNING: unable to detect a file system block size on snapper_thinp/POOL WARNING: using a writecache block size larger than the file system block size may corrupt the file system. Create thin pool volume by combining the cached thin data and meta volumes lvconvert --zero y --thinpool snapper_thinp/POOL --poolmetadata meta --yes WARNING: Converting snapper_thinp/POOL and snapper_thinp/meta to thin pool's data and metadata volumes with metadata wiping. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) Sanity checking pool device (POOL) metadata thin_check /dev/mapper/snapper_thinp-meta_swap.910 examining superblock examining devices tree examining mapping tree checking space map counts Making origin volume lvcreate --yes --virtualsize 1G -T snapper_thinp/POOL -n origin lvcreate --yes --virtualsize 1G -T snapper_thinp/POOL -n other1 WARNING: Sum of all thin volume sizes (2.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --yes --virtualsize 1G -T snapper_thinp/POOL -n other2 WARNING: Sum of all thin volume sizes (3.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --yes -V 1G -T snapper_thinp/POOL -n other3 WARNING: Sum of all thin volume sizes (4.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --yes -V 1G -T snapper_thinp/POOL -n other4 WARNING: Sum of all thin volume sizes (5.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). lvcreate --yes --virtualsize 1G -T snapper_thinp/POOL -n other5 WARNING: Sum of all thin volume sizes (6.00 GiB) exceeds the size of thin pool snapper_thinp/POOL (1.00 GiB). Making snapshot of origin volume lvcreate --yes -y -k n -s /dev/snapper_thinp/origin -n display_snap Display snapshot using lvdisplay Display snapshot using lvs Display snapshot using lvscan Removing snap volume snapper_thinp/display_snap lvremove -f /dev/snapper_thinp/display_snap Removing thin origin and other virtual thin volumes Removing pool snapper_thinp/POOL
Marking VERIFIED in the latest rpms. The remaining thinpool stacked on writecache scenarios passed with the exception of Bug 2033377 (block io scenario now fails to when run on writecache origin volume) kernel-4.18.0-355.el8 BUILT: Mon Dec 13 10:25:24 CST 2021 lvm2-2.03.14-2.el8 BUILT: Fri Dec 17 14:39:40 CST 2021 lvm2-libs-2.03.14-2.el8 BUILT: Fri Dec 17 14:39:40 CST 2021 device-mapper-1.02.181-2.el8 BUILT: Fri Dec 17 14:39:40 CST 2021 device-mapper-libs-1.02.181-2.el8 BUILT: Fri Dec 17 14:39:40 CST 2021
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (lvm2 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2022:2038