Bug 821007 - cling allocation policy should never split data across PVs
cling allocation policy should never split data across PVs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.4
All All
medium Severity medium
: rc
: ---
Assigned To: Alasdair Kergon
Cluster QE
:
Depends On:
Blocks: 687919 821013
  Show dependency treegraph
 
Reported: 2012-05-11 10:40 EDT by Alasdair Kergon
Modified: 2013-02-21 03:09 EST (History)
12 users (show)

See Also:
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.
Story Points: ---
Clone Of:
: 821013 (view as bug list)
Environment:
Last Closed: 2013-02-21 03:09:54 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alasdair Kergon 2012-05-11 10:40:42 EDT
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 19:20:02 EDT
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 19:36:01 EDT
# 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 15:41:09 EDT
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 11:12:52 EDT
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 03:09:54 EST
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.