Bug 1353860
Summary: | lvconvert --splitmirrors and --splitcache fails | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Roman Bednář <rbednar> |
Component: | lvm2 | Assignee: | David Teigland <teigland> |
lvm2 sub component: | Default / Unclassified | QA Contact: | cluster-qe <cluster-qe> |
Status: | CLOSED WONTFIX | Docs Contact: | |
Severity: | unspecified | ||
Priority: | unspecified | CC: | agk, heinzm, jbrassow, msnitzer, prajnoha, teigland, zkabelac |
Version: | 7.3 | ||
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2020-12-15 07:42:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 1354549 | ||
Bug Blocks: |
Description
Roman Bednář
2016-07-08 09:00:12 UTC
Adding reproducer for --splitcache SCENARIO - [test_cache_create] Test cache pool volume creation and combining cache data and cache metadata volumes *** Cache info for this scenario *** * origin (slow): /dev/sdf1 * pool (fast): /dev/sdg1 ************************************ Adding "slow" and "fast" tags to corresponding pvs Create origin (slow) volume lvcreate -L 4G -n corigin cache_sanity @slow lvcreate -L 2G -n test_cache cache_sanity /dev/sdg1 lvcreate -L 8M -n test_cache_meta cache_sanity /dev/sdg1 1A. Test that cache pool volume creation works by combining the cache data and cache metadata (fast) volumes lvconvert --yes --test --type cache-pool --poolmetadata cache_sanity/test_cache_meta cache_sanity/test_cache TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. WARNING: Converting logical volume cache_sanity/test_cache and cache_sanity/test_cache_meta to pool's data and metadata volumes. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) 1B. Test that cache pool volume creation doesn't work by combining a nonexistent cache data and cache metadata (fast) volumes lvconvert --yes --test --type cache-pool --poolmetadata cache_sanity/test_cache_meta cache_sanity/FAKE TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. Failed to find logical volume "cache_sanity/FAKE" Check that no cache pool volume was actually created when attempted with '--test' 2A. Test the origin volume can be cached with lvm auto creating a cash pool out of cache_sanity/test_cache lvconvert --yes --test --type cache --cachepool cache_sanity/test_cache cache_sanity/corigin TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. WARNING: Converting logical volume cache_sanity/test_cache to pool's data volume. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) 2B. Test the origin volume can't be cached since we are attempting with a non existing cache pool TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. Unknown pool data LV FAKE_pool. Implicit conversion of --cachepool arg to type cache-pool failed. Now actually create the cache pool by combining the cache data and cache metadata (fast) volumes lvconvert --yes --type cache-pool --poolmetadata cache_sanity/test_cache_meta cache_sanity/test_cache WARNING: Converting logical volume cache_sanity/test_cache and cache_sanity/test_cache_meta to pool's data and metadata volumes. THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) 3. Test the origin volume can be cached now since we have a proper cache pool (fast) volumes now lvconvert --yes --test --type cache --cachepool cache_sanity/test_cache cache_sanity/corigin TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated. Test that the origin volume was not actually cached when attempted with '--test' Now actually create the cached origin volume Separating cache pool (lvconvert --splitcache) cache_sanity/test_cache from cache origin Cannot convert internal LV cache_sanity/test_cache. couldn't split cache pool volume =========================================== [root@host-082 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices corigin cache_sanity Cwi-a-C--- 4.00g [test_cache] 0.00 100.00 corigin_corig(0) [corigin_corig] cache_sanity owi-aoC--- 4.00g /dev/sdf1(0) [lvol0_pmspare] cache_sanity ewi------- 8.00m /dev/sdg1(514) [test_cache] cache_sanity Cwi---C--- 2.00g test_cache_cdata(0) [test_cache_cdata] cache_sanity Cwi-ao---- 2.00g /dev/sdg1(0) [test_cache_cmeta] cache_sanity ewi-ao---- 8.00m /dev/sdg1(512) [root@host-082 ~]# lvconvert --splitcache /dev/cache_sanity/test_cache Cannot convert internal LV cache_sanity/test_cache. Here's the "right" way to split a cache pool from a cache LV without having to use hidden LVs: [root@null-01 lvm.git]# lvs -a test | grep cpool1 [cpool1] test Cwi---C--- 1.00g [cpool1_cdata] test Cwi------- 1.00g [cpool1_cmeta] test ewi------- 1.00g lvol1 test Cri---C--- 100.00m [cpool1] [root@null-01 lvm.git]# lvconvert --splitcache test/cpool1 Cannot convert internal LV test/cpool1. [root@null-01 lvm.git]# lvconvert --splitcache test/lvol1 Logical volume test/lvol1 is not cached and cache pool test/cpool1 is unused. [root@null-01 lvm.git]# lvs -a test | grep cpool1 cpool1 test Cwi---C--- 1.00g [cpool1_cdata] test Cwi------- 1.00g [cpool1_cmeta] test ewi------- 1.00g I'd prefer to keep it this way, but if specifying the hidden cache pool rather than the cache LV was once an advertised method, then we can add an exception to allow it. If we do allow it, can we exclude it from the list of advertised methods? > lvconvert --yes --splitmirrors 1 --trackchanges split_image/split_origin_corig /dev/sdf1
> Cannot convert internal LV split_image/split_origin_corig.
The "right" way to do this is to run the command on the visible cache LV, not on the hidden _corig LV, i.e.
lvconvert --splitmirrors 1 VG/CacheLV
In this instance I'm even more skeptical that we advertised running the command on the hidden origin, but if we did then we can again add another exception to allow it.
At this moment, the lvconvert code in git allows --splitcache on a hidden/used cache pool disallows --splitmirrors on a hidden/used cache pool My suggestion is that we disallow both, and require these operations to be run on the visible cache LV (both of which currently work.) I'm not entirely sure that removing functionality that has been present until now is safe. But I agree with your approach to disable both for consistency, how about allowing both? I can't think of any good use case right now, but it would give users more control. We will change the scenarios based on the outcome of this bug if needed. Additionally I found another issue with lvconvert. Segfaults when target PV is specified: # lvs -a LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert ... [lvol0_pmspare] vg ewi------- 12.00m mirror_lv vg rwi-a-r--- 1.00g 100.00 [mirror_lv_rimage_0] vg iwi-aor--- 1.00g [mirror_lv_rimage_1] vg iwi-aor--- 1.00g [mirror_lv_rimage_2] vg iwi-aor--- 1.00g [mirror_lv_rmeta_0] vg ewi-aor--- 4.00m [mirror_lv_rmeta_1] vg ewi-aor--- 4.00m [mirror_lv_rmeta_2] vg ewi-aor--- 4.00m # lvconvert --yes --splitmirrors 1 --trackchanges vg/mirror_lv /dev/sdf Segmentation fault (core dumped) # lvconvert --splitmirrors 1 vg/mirror_lv --name split_test --trackchanges mirror_lv_rimage_3 split from mirror_lv for read-only purposes. Use 'lvconvert --merge vg/mirror_lv_rimage_3' to merge back into mirror_lv Valgrind ==13635== LEAK SUMMARY: ==13635== definitely lost: 0 bytes in 0 blocks ==13635== indirectly lost: 0 bytes in 0 blocks ==13635== possibly lost: 0 bytes in 0 blocks ==13635== still reachable: 1,592,035 bytes in 6,933 blocks ==13635== suppressed: 0 bytes in 0 blocks ==13635== ==13635== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) ==13635== ==13635== 1 errors in context 1 of 1: ==13635== Invalid read of size 8 ==13635== at 0x1E4C89: lv_raid_split_and_track (in /usr/sbin/lvm) ==13635== by 0x13AB3E: ??? (in /usr/sbin/lvm) ==13635== by 0x13D6EE: ??? (in /usr/sbin/lvm) ==13635== by 0x163335: process_each_lv_in_vg (in /usr/sbin/lvm) ==13635== by 0x164638: process_each_lv (in /usr/sbin/lvm) ==13635== by 0x140593: lvconvert (in /usr/sbin/lvm) ==13635== by 0x14D8E8: lvm_run_command (in /usr/sbin/lvm) ==13635== by 0x14E48F: lvm2_main (in /usr/sbin/lvm) ==13635== by 0x5B4EB34: (below main) (in /usr/lib64/libc-2.17.so) ==13635== Address 0x48 is not stack'd, malloc'd or (recently) free'd ==13635== ==13635== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) Segmentation fault (core dumped) (In reply to Roman Bednář from comment #7) > Additionally I found another issue with lvconvert. Segfaults when target PV > is specified: This is a different issue and should be a separate bz. Ok, bug 1354549 has been created to track this issue separately. I'm going to let this sit for the time being, which means that --splitcache is the only operation you can be used on an attached/hidden cache pool. Other commands like --splitmirrors need to be run on the cache volume. We're going to be taking a much longer look at the lvconvert interface because there are considerable problems and inconsistencies with it, including the issues above. After evaluating this issue, there are no plans to address it further or fix it in an upcoming release. Therefore, it is being closed. If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened. |