RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1376532 - 'Contiguous' policy should partition the tags across the areas if cling tags are defined in lvm.conf
Summary: 'Contiguous' policy should partition the tags across the areas if cling tags ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2
Version: 7.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-15 16:11 UTC by Corey Marthaler
Modified: 2021-09-03 12:38 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.02.165-3.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 04:18:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
now failing lvcreate -vvvv verbose output (40.89 KB, text/plain)
2016-09-15 16:13 UTC, Corey Marthaler
no flags Details
previously working (in 164-3) lvcreate -vvvv output (192.84 KB, text/plain)
2016-09-15 16:18 UTC, Corey Marthaler
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:1445 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2016-11-03 13:46:41 UTC

Description Corey Marthaler 2016-09-15 16:11:16 UTC
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>

Comment 2 Corey Marthaler 2016-09-15 16:13:51 UTC
Created attachment 1201313 [details]
now failing lvcreate -vvvv verbose output

Comment 3 Corey Marthaler 2016-09-15 16:18:10 UTC
Created attachment 1201314 [details]
previously working (in 164-3) lvcreate -vvvv output

Comment 4 Corey Marthaler 2016-09-15 16:24:22 UTC
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

Comment 5 Corey Marthaler 2016-09-15 16:32:18 UTC
# 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)

Comment 6 Corey Marthaler 2016-09-15 16:47:39 UTC
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)

Comment 7 Alasdair Kergon 2016-09-16 00:06:56 UTC
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.

Comment 8 Alasdair Kergon 2016-09-16 01:22:38 UTC
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.)

Comment 13 Corey Marthaler 2016-09-21 19:53:37 UTC
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

Comment 15 errata-xmlrpc 2016-11-04 04:18:50 UTC
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


Note You need to log in before you can comment on or make changes to this bug.