Hide Forgot
Description of problem: This is a regression of bug 983600 introduced in 164-4 I believe. This works properly in 164-3. host-119: pvcreate /dev/sdf2 /dev/sdf1 /dev/sdh2 /dev/sdh1 /dev/sde2 /dev/sde1 /dev/sdb2 /dev/sdb1 /dev/sdd2 /dev/sdd1 host-119: vgcreate mirror_sanity /dev/sdf2 /dev/sdf1 /dev/sdh2 /dev/sdh1 /dev/sde2 /dev/sde1 /dev/sdb2 /dev/sdb1 /dev/sdd2 /dev/sdd1 ============================================================ Iteration 1 of 1 started at Thu Sep 15 10:56:37 CDT 2016 ============================================================ 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/sdb1 /dev/sdb2 /dev/sdd1 /dev/sdd2 /dev/sde1 /dev/sde2 Add tags distributed in a group (A,A,A,B,B,B) to PVs pvchange --addtag A /dev/sdb1 /dev/sdb2 /dev/sdd1 pvchange --addtag B /dev/sdd2 /dev/sde1 /dev/sde2 lvm2-2.02.164-3.el7.x86_64 cling_tag_list = [ "@A", "@B" ] [root@host-119 ~]# pvs -a -o +devices,pv_tags PV VG Fmt Attr PSize PFree Devices PV Tags /dev/sdb1 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdb2 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdd1 mirror_sanity lvm2 a-- 548.00m 548.00m A /dev/sdd2 mirror_sanity lvm2 a-- 548.00m 548.00m B /dev/sde1 mirror_sanity lvm2 a-- 548.00m 548.00m B /dev/sde2 mirror_sanity lvm2 a-- 548.00m 548.00m B [root@host-119 ~]# lvcreate --alloc cling_by_tags --type mirror -m 1 -n cling_mirror -L 600M mirror_sanity Logical volume "cling_mirror" created. [root@host-119 ~]# lvs -a -o +devices LV VG Attr LSize Log Cpy%Sync Devices cling_mirror mirror_sanity mwl-a-m--- 600.00m [cling_mirror_mlog] 52.67 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/sdd2(0) [cling_mirror_mimage_1] mirror_sanity Iwl-aom--- 600.00m /dev/sde1(0) [cling_mirror_mlog] mirror_sanity lwl-aom--- 4.00m /dev/sde1(13) lvm2-2.02.165-2.el7 cling_tag_list = [ "@A", "@B" ] [root@host-118 ~]# pvs -a -o +devices,pv_tags PV VG Fmt Attr PSize PFree Devices PV Tags /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 B [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. #format_text/archiver.c:141 Archiving volume group "mirror_sanity" metadata (seqno 8). #metadata/lv_manip.c:5591 Creating logical volume cling_mirror #metadata/lv_manip.c:3998 Adding segment of type mirror to LV cling_mirror. #libdm-config.c:1036 Setting allocation/mirror_logs_require_separate_pvs to 0 #metadata/lv_manip.c:3315 Adjusted allocation request to 150 logical extents. Existing size 0. New size 150. #config/config.c:1463 Setting allocation/cling_tag_list to cling_tag_list = [ "@A", "@B" ] #libdm-config.c:1036 Setting allocation/maximise_cling to 1 #metadata/pv_map.c:54 Allowing allocation on /dev/sdb1 start PE 0 length 137 #metadata/pv_map.c:54 Allowing allocation on /dev/sdb2 start PE 0 length 137 #metadata/pv_map.c:54 Allowing allocation on /dev/sdc1 start PE 0 length 137 #metadata/pv_map.c:54 Allowing allocation on /dev/sdc2 start PE 0 length 137 #metadata/pv_map.c:54 Allowing allocation on /dev/sdd1 start PE 0 length 137 #metadata/pv_map.c:54 Allowing allocation on /dev/sdd2 start PE 0 length 137 #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 300 total extents from 822 remaining (0 positional slots): #metadata/lv_manip.c:2597 2 (2 data/0 parity) parallel areas of 150 extents each #metadata/lv_manip.c:2601 0 mirror logs of 0 extents each #metadata/lv_manip.c:2256 Considering allocation area 0 as /dev/sdb1 start PE 0 length 137 leaving 0 with PV tags: A. #metadata/lv_manip.c:2256 Considering allocation area 1 as /dev/sdb2 start PE 0 length 137 leaving 0 with PV tags: A. #metadata/lv_manip.c:2256 Considering allocation area 2 as /dev/sdc1 start PE 0 length 137 leaving 0 with PV tags: A. #metadata/lv_manip.c:2256 Considering allocation area 3 as /dev/sdc2 start PE 0 length 137 leaving 0 with PV tags: B. #metadata/lv_manip.c:2256 Considering allocation area 4 as /dev/sdd1 start PE 0 length 137 leaving 0 with PV tags: B. #metadata/lv_manip.c:2256 Considering allocation area 5 as /dev/sdd2 start PE 0 length 137 leaving 0 with PV tags: B. #metadata/lv_manip.c:2818 Sorting 6 areas #metadata/lv_manip.c:2098 Eliminating allocation area 1 at PV /dev/sdb2 start PE 0 from consideration: PV tag A already used. #metadata/lv_manip.c:2098 Eliminating allocation area 2 at PV /dev/sdc1 start PE 0 from consideration: PV tag A already used. #metadata/lv_manip.c:2098 Eliminating allocation area 4 at PV /dev/sdd1 start PE 0 from consideration: PV tag B already used. #metadata/lv_manip.c:2098 Eliminating allocation area 5 at PV /dev/sdd2 start PE 0 from consideration: PV tag B already used. #metadata/lv_manip.c:1837 Allocating parallel area 0 on /dev/sdb1 start PE 0 length 137. #metadata/lv_manip.c:1837 Allocating parallel area 1 on /dev/sdc2 start PE 0 length 137. #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 2 preferred area(s) to be filled positionally. #metadata/lv_manip.c:2594 Still need 26 total extents from 548 remaining (2 positional slots): #metadata/lv_manip.c:2597 2 (2 data/0 parity) parallel areas of 13 extents each #metadata/lv_manip.c:2601 0 mirror logs of 0 extents each #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 2 preferred area(s) to be filled positionally. #metadata/lv_manip.c:2594 Still need 26 total extents from 548 remaining (2 positional slots): #metadata/lv_manip.c:2597 2 (2 data/0 parity) parallel areas of 13 extents each #metadata/lv_manip.c:2601 0 mirror logs of 0 extents each #metadata/lv_manip.c:2094 Matched allocation PV tag A on existing /dev/sdb2 with free space on /dev/sdb1. #metadata/lv_manip.c:2256 Considering allocation area 0 as /dev/sdb2 start PE 0 length 137 leaving 0 with PV tags: A. #metadata/lv_manip.c:2094 Matched allocation PV tag B on existing /dev/sdd1 with free space on /dev/sdc2. #metadata/lv_manip.c:2256 Considering allocation area 1 as /dev/sdd1 start PE 0 length 137 leaving 0 with PV tags: B. #metadata/lv_manip.c:1837 Allocating parallel area 0 on /dev/sdb2 start PE 0 length 13. #metadata/lv_manip.c:1837 Allocating parallel area 1 on /dev/sdd1 start PE 0 length 13. #metadata/lv_manip.c:5591 Creating logical volume cling_mirror_mimage_0 #metadata/lv_manip.c:1136 Stack cling_mirror:0[0] on LV cling_mirror_mimage_0:0 #metadata/lv_manip.c:740 Adding cling_mirror:0 as an user of cling_mirror_mimage_0 #metadata/lv_manip.c:5591 Creating logical volume cling_mirror_mimage_1 #metadata/lv_manip.c:1136 Stack cling_mirror:0[1] on LV cling_mirror_mimage_1:0 #metadata/lv_manip.c:740 Adding cling_mirror:0 as an user of cling_mirror_mimage_1 #mm/memlock.c:562 Unlock: Memlock counters: locked:0 critical:0 daemon:0 suspended:0 #activate/dev_manager.c:755 Getting device info for mirror_sanity-cling_mirror [LVM-dbxQORLWk2VzdidxHNRCfAvgq6ecbJprkXHbZ6Hi2lXeFuXGkB0Vvc942uGYdGll] #ioctl/libdm-iface.c:1838 dm info LVM-dbxQORLWk2VzdidxHNRCfAvgq6ecbJprkXHbZ6Hi2lXeFuXGkB0Vvc942uGYdGll [ noopencount flush ] [16384] (*1) #activate/dev_manager.c:683 Skipping checks for old devices without LVM- dm uuid prefix (kernel vsn 3 >= 3). #activate/activate.c:1487 mirror_sanity/cling_mirror is not active #libdm-config.c:1036 Setting allocation/mirror_logs_require_separate_pvs to 0 #metadata/lv_manip.c:3315 Adjusted allocation request to 0 logical extents. Existing size 0. New size 0. #metadata/lv_manip.c:3318 Mirror log of 1 extents of size 8192 sectors needed for region size 1024. #config/config.c:1463 Setting allocation/cling_tag_list to cling_tag_list = [ "@A", "@B" ] #libdm-config.c:1036 Setting allocation/maximise_cling to 1 #metadata/pv_map.c:54 Allowing allocation on /dev/sdb2 start PE 13 length 124 #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>
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