Description of problem: This issue was brought up by Jon in this mornings LVM meeting... If you have a VG with plenty of PVs in it, and you attempt to convert your 2-way mirror to 4-way, but only specify 1 PV to use, that attempt fails due to the lack of space, even though LVM could technically just pick another PV to use from the available list in the VG. [root@hayes-01 ~]# lvconvert -m3 VG/mirror /dev/etherd/e1.1p13 Not enough PVs with free space available for parallel allocation. Consider --alloc anywhere if desperate. Unable to allocate extents for mirror(s). However, if the opposite is tried, you attempt to convert your 4-way mirror to a 2-way mirror, but only specify 1 PV to use, that attempt succeeds with LVM arbitrarily picking the other PV to remove. [root@hayes-01 ~]# lvconvert -m1 VG/mirror /dev/etherd/e1.1p13 Logical volume mirror converted. This appears inconsistent, both attempts should either fail or succeed. Version-Release number of selected component (if applicable): 2.6.18-162.el5 lvm2-2.02.54-1.el5 BUILT: Thu Nov 12 05:28:35 CST 2009 lvm2-cluster-2.02.54-1.el5 BUILT: Thu Nov 12 05:27:29 CST 2009 device-mapper-1.02.39-1.el5 BUILT: Wed Nov 11 12:31:44 CST 2009 cmirror-1.1.39-2.el5 BUILT: Mon Jul 27 15:39:05 CDT 2009 kmod-cmirror-0.1.22-1.el5 BUILT: Mon Jul 27 15:28:46 CDT 2009 How reproducible: Everytime
Well, my understanding of this is that for extension, the PVs given mean a set of what the system may choose from to allocate as it wishes (but not any more), whereas upon shrinking, it is the list of PVs you want to free up (freeing up extra is fine). However, I don't have a strong opinion about this.
Yes, the behavior is suspect... I'm sure it will involve a discussion about historical behavior. Petr shows the other side. Perhaps we don't even need this bug. I'll leave it for now.
Closing this bug WONTFIX. I don't intend to change the behaviour of the way lvconvert works on mirrors at this stage. However, it should be noted that 'raid1' type mirrors in RHEL6+ do behave in the way suggested in the original description, while 'mirror's still behave in the (subjectively) abnormal/inconsistent way.