Bug 1376532
| Summary: | 'Contiguous' policy should partition the tags across the areas if cling tags are defined in lvm.conf | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> | ||||||
| Component: | lvm2 | Assignee: | LVM and device-mapper development team <lvm-team> | ||||||
| lvm2 sub component: | Mirroring and RAID | QA Contact: | cluster-qe <cluster-qe> | ||||||
| Status: | CLOSED ERRATA | Docs Contact: | |||||||
| Severity: | medium | ||||||||
| Priority: | unspecified | CC: | agk, heinzm, jbrassow, msnitzer, mthacker, prajnoha, prockai, tlavigne, zkabelac | ||||||
| Version: | 7.3 | Keywords: | Regression | ||||||
| Target Milestone: | rc | ||||||||
| Target Release: | --- | ||||||||
| Hardware: | x86_64 | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | lvm2-2.02.165-3.el7 | Doc Type: | If docs needed, set a value | ||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2016-11-04 04:18:50 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: | |||||||||
| Attachments: |
|
||||||||
|
Description
Corey Marthaler
2016-09-15 16:11:16 UTC
Created attachment 1201313 [details]
now failing lvcreate -vvvv verbose output
Created attachment 1201314 [details]
previously working (in 164-3) lvcreate -vvvv output
This appears to be the diff of the allocate section that works in 164-3 but fails in 165-2. < #metadata/pv_map.c:54 Allowing allocation on /dev/sdc1 start PE 0 length 137 < #metadata/pv_map.c:54 Allowing allocation on /dev/sdd1 start PE 13 length 124 < #metadata/pv_map.c:54 Allowing allocation on /dev/sdd2 start PE 0 length 137 < #metadata/lv_manip.c:2211 Parallel PVs at LE 0 length 137: /dev/sdb1(A) /dev/sdc2(B) < #metadata/lv_manip.c:2211 Parallel PVs at LE 137 length 13: /dev/sdb2(A) /dev/sdd1(B) < #metadata/lv_manip.c:3076 Trying allocation using contiguous policy. < #metadata/lv_manip.c:2678 Areas to be sorted and filled sequentially. < #metadata/lv_manip.c:2594 Still need 1 total extents from 522 remaining (0 positional slots): < #metadata/lv_manip.c:2597 0 (0 data/0 parity) parallel areas of 0 extents each < #metadata/lv_manip.c:2601 1 mirror log of 1 extents each < #metadata/lv_manip.c:2091 Not using free space on /dev/sdb2: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdc1: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd1: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd2: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:3076 Trying allocation using cling policy. < #metadata/lv_manip.c:2673 Cling_to_allocated is set < #metadata/lv_manip.c:2676 0 preferred area(s) to be filled positionally. < #metadata/lv_manip.c:2594 Still need 1 total extents from 522 remaining (0 positional slots): < #metadata/lv_manip.c:2597 0 (0 data/0 parity) parallel areas of 0 extents each < #metadata/lv_manip.c:2601 1 mirror log of 1 extents each < #metadata/lv_manip.c:2091 Not using free space on /dev/sdb2: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdc1: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd1: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd2: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:3076 Trying allocation using cling_by_tags policy. < #metadata/lv_manip.c:2673 Cling_to_allocated is set < #metadata/lv_manip.c:2676 0 preferred area(s) to be filled positionally. < #metadata/lv_manip.c:2594 Still need 1 total extents from 522 remaining (0 positional slots): < #metadata/lv_manip.c:2597 0 (0 data/0 parity) parallel areas of 0 extents each < #metadata/lv_manip.c:2601 1 mirror log of 1 extents each < #metadata/lv_manip.c:2091 Not using free space on /dev/sdb2: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdc1: Matched allocation PV tag A on existing parallel PV /dev/sdb1. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd1: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:2091 Not using free space on /dev/sdd2: Matched allocation PV tag B on existing parallel PV /dev/sdc2. < #metadata/lv_manip.c:3123 Insufficient free space for log allocation for logical volume . < #metadata/lv_manip.c:3392 <backtrace> < #metadata/mirror.c:2020 Unable to allocate extents for mirror log. < #metadata/lv_manip.c:7512 <backtrace> < #libdm-config.c:1036 Setting devices/issue_discards to 0 < #libdm-config.c:1036 Setting devices/issue_discards to 0 < #libdm-config.c:1036 Setting devices/issue_discards to 0 < #libdm-config.c:1036 Setting devices/issue_discards to 0 < #metadata/pv_manip.c:420 /dev/sdb1 0: 0 137: NULL(0:0) < #metadata/pv_manip.c:420 /dev/sdb2 0: 0 137: NULL(0:0) < #metadata/pv_manip.c:420 /dev/sdc1 0: 0 137: NULL(0:0) < #metadata/pv_manip.c:420 /dev/sdc2 0: 0 137: NULL(0:0) --- > #metadata/pv_map.c:54 Allowing allocation on /dev/sdd1 start PE 0 length 137 > #metadata/pv_map.c:54 Allowing allocation on /dev/sde1 start PE 13 length 124 > #metadata/pv_map.c:54 Allowing allocation on /dev/sde2 start PE 0 length 137 > #metadata/lv_manip.c:1713 Parallel PVs at LE 0 length 137: /dev/sdb1 /dev/sdd2 > #metadata/lv_manip.c:1713 Parallel PVs at LE 137 length 13: /dev/sdb2 /dev/sde1 > #metadata/lv_manip.c:3043 Trying allocation using contiguous policy. > #metadata/lv_manip.c:2645 Areas to be sorted and filled sequentially. > #metadata/lv_manip.c:2561 Still need 1 total extents from 522 remaining (0 positional slots): > #metadata/lv_manip.c:2564 0 (0 data/0 parity) parallel areas of 0 extents each > #metadata/lv_manip.c:2568 1 mirror log of 1 extents each > #metadata/lv_manip.c:2230 Considering allocation area 0 as /dev/sdb2 start PE 13 length 1 leaving 123 with PV tags: A. > #metadata/lv_manip.c:2230 Considering allocation area 1 as /dev/sdd1 start PE 0 length 1 leaving 136 with PV tags: A. > #metadata/lv_manip.c:2230 Considering allocation area 2 as /dev/sde1 start PE 13 length 1 leaving 123 with PV tags: B. > #metadata/lv_manip.c:2230 Considering allocation area 3 as /dev/sde2 start PE 0 length 1 leaving 136 with PV tags: B. > #metadata/lv_manip.c:2785 Sorting 4 areas > #metadata/lv_manip.c:2142 Eliminating allocation area 1 at PV /dev/sdd1 start PE 0 from consideration: PV tag A already used. > #metadata/lv_manip.c:2142 Eliminating allocation area 3 at PV /dev/sde2 start PE 0 from consideration: PV tag B already used. > #metadata/lv_manip.c:1880 Allocating parallel area 0 on /dev/sde1 start PE 13 length 1. > #activate/dev_manager.c:755 Getting device info for mirror_sanity-cling_mirror [LVM-K4A0DoGjv0fqolLjUU81geQHEroFzaPl9Bxv95rju7lDE5rH3TO0zHRla19Mi4xT] > #ioctl/libdm-iface.c:1838 dm info LVM-K4A0DoGjv0fqolLjUU81geQHEroFzaPl9Bxv95rju7lDE5rH3TO0zHRla19Mi4xT [ noopencount flush ] [16384] (*1) > #metadata/lv_manip.c:5558 Creating logical volume cling_mirror_mlog > #activate/dev_manager.c:755 Getting device info for mirror_sanity-cling_mirror_mlog [LVM-K4A0DoGjv0fqolLjUU81geQHEroFzaPluHa3Uoz8pC6Dtp8AexQgV0fCrmlEFRs9] > #ioctl/libdm-iface.c:1838 dm info LVM-K4A0DoGjv0fqolLjUU81geQHEroFzaPluHa3Uoz8pC6Dtp8AexQgV0fCrmlEFRs9 [ noopencount flush ] [16384] (*1) > #activate/activate.c:1487 mirror_sanity/cling_mirror_mlog is not active > #metadata/pv_manip.c:420 /dev/sdb1 0: 0 137: cling_mirror_mimage_0(0:0) > #metadata/pv_manip.c:420 /dev/sdb2 0: 0 13: cling_mirror_mimage_0(137:0) > #metadata/pv_manip.c:420 /dev/sdb2 1: 13 124: NULL(0:0) 379c360,364 < #metadata/pv_manip.c:420 /dev/sdd2 0: 0 137: NULL(0:0) --- > #metadata/pv_manip.c:420 /dev/sdd2 0: 0 137: cling_mirror_mimage_1(0:0) > #metadata/pv_manip.c:420 /dev/sde1 0: 0 13: cling_mirror_mimage_1(137:0) > #metadata/pv_manip.c:420 /dev/sde1 1: 13 1: cling_mirror_mlog(0:0) > #metadata/pv_manip.c:420 /dev/sde1 2: 14 123: NULL(0:0) > #metadata/pv_manip.c:420 /dev/sde2 0: 0 137: NULL(0:0) 385c370 < #format_text/format-text.c:665 Writing mirror_sanity metadata to /dev/sdb1 at 20992 len 1650 # log [root@host-118 ~]# lvcreate --alloc cling_by_tags --type mirror -m 1 -n cling_mirror -L 600M mirror_sanity Insufficient free space for log allocation for logical volume . Unable to allocate extents for mirror log. # no log [root@host-118 ~]# lvcreate --alloc cling_by_tags --type mirror --mirrorlog core -m 1 -n cling_mirror -L 600M mirror_sanity Logical volume "cling_mirror" created. [root@host-118 ~]# lvs -a -o +devices LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices cling_mirror mirror_sanity mwl-a-m--- 600.00m 37.33 cling_mirror_mimage_0(0),cling_mirror_mimage_1(0) [cling_mirror_mimage_0] mirror_sanity Iwl-aom--- 600.00m /dev/sdb1(0) [cling_mirror_mimage_0] mirror_sanity Iwl-aom--- 600.00m /dev/sdb2(0) [cling_mirror_mimage_1] mirror_sanity Iwl-aom--- 600.00m /dev/sdc2(0) [cling_mirror_mimage_1] mirror_sanity Iwl-aom--- 600.00m /dev/sdd1(0) A third tag allows it to work. /dev/sdb1 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdb2 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdc1 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdc2 mirror_sanity lvm2 a-- 548.00m 548.00m B /dev/sdd1 mirror_sanity lvm2 a-- 548.00m 548.00m B /dev/sdd2 mirror_sanity lvm2 a-- 548.00m 548.00m C [root@host-118 ~]# lvcreate --alloc cling_by_tags --type mirror -m 1 -n cling_mirror -L 600M mirror_sanity Logical volume "cling_mirror" created. [root@host-118 ~]# lvs -a -o +devices LV VG Attr LSize Log Cpy%Sync Devices cling_mirror mirror_sanity mwl-a-m--- 600.00m [cling_mirror_mlog] 55.33 cling_mirror_mimage_0(0),cling_mirror_mimage_1(0) [cling_mirror_mimage_0] mirror_sanity Iwl-aom--- 600.00m /dev/sdb1(0) [cling_mirror_mimage_0] mirror_sanity Iwl-aom--- 600.00m /dev/sdb2(0) [cling_mirror_mimage_1] mirror_sanity Iwl-aom--- 600.00m /dev/sdc2(0) [cling_mirror_mimage_1] mirror_sanity Iwl-aom--- 600.00m /dev/sdd1(0) [cling_mirror_mlog] mirror_sanity lwl-aom--- 4.00m /dev/sdd2(0) So what's happening here is the current code is (1) creating the mirror without log (2) adding a log Step (2) is trying to add it in parallel to the existing legs. If it can't find space, when it reaches the alloc normal policy, if mirror_logs_require_separate_pvs is unset it tries again ignoring the parallel PVs. The change fixed the parallel PV tag checking so it "correctly" finds there's no space in your test case. Firstly, the whole thing should be done in one call to the allocation code, not two. Secondly, the details of the allocation loop need fixing to understand that the log extents should cling to the respective parallel PV tags, but similarly try separate PVs first. This might require additional passes round the main loop. Alternatively there might be a way to perform the allocation like 'lvextend' instead of supplying the existing allocations as parallel PVs. As the correct way to enhance this code needs time to work out, I've committed a workaround to try to get us past this for now and leave the behaviour no worse than it was before. At any point that the allocator is left only trying to allocate a mirror log, it relaxes the policy to --alloc normal so it can succeed again like it used to do. (It will prefer PVs that have not yet been used by the LV, then if the config setting allows, try other PVs - all ignoring tags.) https://www.redhat.com/archives/lvm-devel/2016-September/msg00044.html http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9c8c8fb63abd1a36b9c448450c9cccfac4c0299e All cling mirror test cases pass again. Marking verified with the latest rpms. 3.10.0-501.el7.x86_64 lvm2-2.02.165-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 lvm2-libs-2.02.165-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 lvm2-cluster-2.02.165-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 device-mapper-1.02.134-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 device-mapper-libs-1.02.134-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 device-mapper-event-1.02.134-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 device-mapper-event-libs-1.02.134-3.el7 BUILT: Wed Sep 21 08:26:18 CDT 2016 device-mapper-persistent-data-0.6.3-1.el7 BUILT: Fri Jul 22 05:29:13 CDT 2016 ============================================================ Iteration 1 of 1 started at Wed Sep 21 14:35:56 CDT 2016 ============================================================ SCENARIO - [cling_extend_mirror_no_avail_tagged_extents] Verify that mirror extends honor the cling by tags allocation policy when there are *not* enough PVs with tags present for extension to work Add tags to random PVs Create a mirror using the tagged PVs host-119: lvcreate --type mirror -m 1 -n cling_mirror -l 2558 mirror_sanity /dev/sda1 /dev/sde2 /dev/sde1:50 Attempt to extend using the cling_by_tags policy: host-119: lvextend -l 5116 --alloc cling_by_tags mirror_sanity/cling_mirror Deactivating mirror cling_mirror... and removing SCENARIO - [cling_create_mirror_tag_distrib_every_other] Verify that mirror creation honors the cling by tags allocation policy regardless of tag distribution, in this case every other (A,B,A,B,A,B) Recreating VG with just 6 tagged devices host-119: vgcreate mirror_sanity /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 Add tags distributed every other (A,B,A,B,A,B) to PVs Create a mirror using the tagged PVs host-119: lvcreate --alloc cling_by_tags --type mirror -m 1 -n cling_mirror -L 600M mirror_sanity Deactivating mirror cling_mirror... and removing Restoring VG back to default parameters vgremove --yes mirror_sanity pvremove --yes /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 pvcreate /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 vgcreate mirror_sanity /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 SCENARIO - [cling_extend_mirror_avail_vg_extents_but_none_tagged] Check for corruption messages when attempting to extend beyond the available tagged extents, but not beyond the available VG extents Recreating VG with just 4 tagged devices host-119: vgcreate mirror_sanity /dev/sdd2 /dev/sde2 /dev/sdc2 /dev/sdd1 Add tags to random PVs Create a mirror using the tagged PVs host-119: lvcreate --type mirror -m 1 -n cling_mirror -L 1G mirror_sanity /dev/sdd2 /dev/sde2 /dev/sdd1:50 Attempt to extend using the cling_by_tags policy: host-119: lvextend -L 2G --alloc cling_by_tags mirror_sanity/cling_mirror Deactivating mirror cling_mirror... and removing Restoring VG back to default parameters vgremove --yes mirror_sanity pvremove --yes /dev/sdd2 /dev/sde2 /dev/sdc2 /dev/sdd1 pvcreate /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 vgcreate mirror_sanity /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 SCENARIO - [cling_create_mirror_tag_distrib_grouped] Verify that mirror creation honors the cling by tags allocation policy egardless of tag distribution, in this case grouped (A,A,A,B,B,B) Recreating VG with just 6 tagged devices host-119: vgcreate mirror_sanity /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 Add tags distributed in a group (A,A,A,B,B,B) to PVs Create a mirror using the tagged PVs host-119: lvcreate --alloc cling_by_tags --type mirror -m 1 -n cling_mirror -L 600M mirror_sanity Deactivating mirror cling_mirror... and removing Restoring VG back to default parameters vgremove --yes mirror_sanity pvremove --yes /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 pvcreate /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 vgcreate mirror_sanity /dev/sda1 /dev/sda2 /dev/sdb1 /dev/sdb2 /dev/sdc1 /dev/sdc2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 SCENARIO - [cling_extend_mirror_avail_tagged_extents] Verify that mirror extends honor the cling by tags allocation policy when there are enough PVs with tags present for extension to work Add tags to random PVs Create a mirror using the tagged PVs host-119: lvcreate --type mirror -m 1 -n cling_mirror -l 2558 mirror_sanity /dev/sdc1 /dev/sdc2 /dev/sdb1:50 Extend using the cling_by_tags policy: host-119 lvextend -l 5116 --alloc cling_by_tags mirror_sanity/cling_mirror Verify mimage_0 is made up of /dev/sdc1 and /dev/sda1 (both with tag A) Verify mimage_1 is made up of /dev/sdc2 and /dev/sdd2 (both with tag B) Deactivating mirror cling_mirror... and removing 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, 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://rhn.redhat.com/errata/RHBA-2016-1445.html |