Bug 821007 - cling allocation policy should never split data across PVs
Summary: cling allocation policy should never split data across PVs
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: All
OS: All
medium
medium
Target Milestone: rc
: ---
Assignee: Alasdair Kergon
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks: 687919 821013
TreeView+ depends on / blocked
 
Reported: 2012-05-11 14:40 UTC by Alasdair Kergon
Modified: 2013-02-21 08:09 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.97-2.el6
Doc Type: Bug Fix
Doc Text:
The 'cling' allocation policy is behaving like the 'normal' policy when there is no pre-existing preceding segment to cling to. The policy now behaves correctly.
Clone Of:
: 821013 (view as bug list)
Environment:
Last Closed: 2013-02-21 08:09:54 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

Description Alasdair Kergon 2012-05-11 14:40:42 UTC
The 'cling' allocation policy is behaving like the 'normal' policy when there is no pre-existing preceding segment to cling to.

Example:
Use lvcreate with --alloc cling to create a linear device that fits within the VG but is too large to fit on any single PV in the VG.  It succeeds, placing the data across multiple PVs.  It should fail.

Comment 1 Alasdair Kergon 2012-05-11 23:20:02 UTC
Patch to fix 3 different ways in which 'cling' incorrectly gives an outcome like 'normal':

http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/lv_manip.c.diff?cvsroot=lvm2&r1=text&tr1=1.375&r2=text&tr2=1.380&f=u

Comment 2 Alasdair Kergon 2012-05-11 23:36:01 UTC
# pvs

  PV         VG   Fmt  Attr PSize  PFree

  /dev/loop0 vg3  lvm2 a-   96.00m 28.00m

  /dev/loop1 vg3  lvm2 a-   96.00m 96.00m


# lvs

  LV    VG   Attr   LSize   

  lvol0 vg3  -wi---  68.00m  


Before:

# lvextend vg3/lvol0 -L +36M --alloc cling

  Extending logical volume lvol0 to 104.00 MiB

  Logical volume lvol0 successfully resized


After:

# lvextend vg3/lvol0 -L +36M --alloc cling

  Extending logical volume lvol0 to 104.00 MiB

  Insufficient suitable allocatable extents for logical volume lvol0: 2 more required


Same for lvcreate.

Comment 3 Corey Marthaler 2012-07-26 19:41:09 UTC
Adding QA ack for 6.4.

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.

Comment 5 Nenad Peric 2012-09-13 15:12:52 UTC
Tested with both lvcreate and lvextend. 

Both are failing as expected if the PV size is smaller than the needed size while using --alloc cling.


(10:11:03) [root@r6-node01:~]$ lvcreate small_vg -L220M --alloc cling -n big2_lv
  Insufficient suitable allocatable extents for logical volume big2_lv: 6 more required

------------------------------------------


(10:13:38) [root@r6-node01:~]$ lvs
  LV      VG       Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert
  lv_root VolGroup -wi-ao--   6.54g                                           
  lv_swap VolGroup -wi-ao--   1.97g                                           
  big2_lv small_vg -wl-a--- 132.00m                                           
(10:13:47) [root@r6-node01:~]$ lvextend small_vg/big2_lv -L +68M
  Extending logical volume big2_lv to 200.00 MiB
  Insufficient suitable allocatable extents for logical volume big2_lv: 1 more required

10:14:07) [root@r6-node01:~]$ pvs
  PV         VG       Fmt  Attr PSize   PFree  
  /dev/sda1  small_vg lvm2 a--  196.00m  64.00m
  /dev/sdd1  small_vg lvm2 a--  196.00m 196.00m
  /dev/sdf1           lvm2 a--   10.00g  10.00g
  /dev/sdg1           lvm2 a--   10.00g  10.00g
  /dev/vda2  VolGroup lvm2 a--    8.51g      0 

(10:16:56) [root@r6-node01:~]$ lvs -a -o +devices
  LV      VG       Attr     LSize   Pool Origin Data%  Move Log Copy%  Convert Devices        
  lv_root VolGroup -wi-ao--   6.54g                                            /dev/vda2(0)   
  lv_swap VolGroup -wi-ao--   1.97g                                            /dev/vda2(1674)
  big2_lv small_vg -wl-a--- 132.00m                                            /dev/sda1(0)

Comment 6 errata-xmlrpc 2013-02-21 08:09:54 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.

http://rhn.redhat.com/errata/RHBA-2013-0501.html


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