Bug 806885 - lvextend fails to extend striped thin volume with --use-policies
lvextend fails to extend striped thin volume with --use-policies
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2 (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Zdenek Kabelac
Cluster QE
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-26 08:36 EDT by Nenad Peric
Modified: 2012-06-20 11:03 EDT (History)
10 users (show)

See Also:
Fixed In Version: lvm2-2.02.95-4.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-20 11:03:12 EDT
Type: ---
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 Nenad Peric 2012-03-26 08:36:38 EDT
Description of problem:

Using a thin volume, while creating a file greater than the current thin_pool size, the increase in the thin_pool size should occur. 

dmeventd was running but the LV was not increased. 

upon manual attempt this was the error:

[root@node01:~]$ lvextend --use-policies main_vg/thin_pool
  Extending logical volume thin_pool to 156.00 MiB
  Number of extents requested (7) needs to be divisible by 2.

in /var/log/messages the same can be seen:

Mar 26 07:10:46 node01 lvm[2230]: Thin main_vg-thin_pool-tpool is now 100% full.
Mar 26 07:10:46 node01 kernel: device-mapper: thin: 253:4: reached low water mark, sending event.
Mar 26 07:10:46 node01 kernel: device-mapper: thin: 253:4: no free space available.
Mar 26 07:10:46 node01 lvm[2230]: Extending logical volume thin_pool to 156.00 MiB
Mar 26 07:10:46 node01 lvm[2230]: Number of extents requested (7) needs to be divisible by 2.
Mar 26 07:10:46 node01 lvm[2230]: Failed to extend thin main_vg-thin_pool-tpool.


[root@node01:~]$ vgs
  VG       #PV #LV #SN Attr   VSize  VFree 
  VolGroup   1   2   0 wz--n-  9.51g     0 
  main_vg    4   3   0 wz--n- 39.03g 38.90g

(07:23:50) [root@node01:~]$ lvs
  LV        VG       Attr     LSize   Pool      Origin Data%  Move Log Copy%  Convert
  lv_root   VolGroup -wi-ao--   7.54g                                                
  lv_swap   VolGroup -wi-ao--   1.97g                                                
  lvol0     main_vg  Vwi-aotz   2.00g thin_pool          6.24                        
  lvol1     main_vg  Vwi-a-tz   2.00g thin_pool lvol0    4.78                        
  thin_pool main_vg  twi-a-tz 128.00m                  100.00

Specifying the size has to be precise as well, no rounding seems to take place:

[root@node01:~]$ lvextend -L+60M main_vg/thin_pool
  Extending logical volume thin_pool to 188.00 MiB
  Number of extents requested (15) needs to be divisible by 2.




Version-Release number of selected component (if applicable):


lvm2-2.02.96-0.85.el6.x86_64
lvm2-libs-2.02.96-0.85.el6.x86_64
device-mapper-event-1.02.75-0.85.el6.x86_64
device-mapper-libs-1.02.75-0.85.el6.x86_64
device-mapper-event-libs-1.02.75-0.85.el6.x86_64
device-mapper-persistent-data-0.1.4-1.el6.x86_64
device-mapper-1.02.75-0.85.el6.x86_64
kernel 2.6.32-251.el6.x86_64



How reproducible:

Everytime

Steps to Reproduce:
1. create VG, create a striped thin pool 

lvcreate -i 2 -T -L128M main_vg/thin_pool

2. create a thin LV and create a FS,

lvcreate -T -V2G main_vg/thin_pool

mke2fs -t ext3 /dev/main_vg/lvol0

3. Write data which is larger than thin_pool initial size of 128M:

dd if=/dev/urandom of=/mnt/testfile2 bs=1024 count=143141

  
Actual results:

The I/O is stuck, the LV does not get increased. 

/var/log/messages:

ar 26 07:41:21 node01 kernel: device-mapper: thin: 253:4: reached low water mark, sending event.
Mar 26 07:41:21 node01 lvm[2230]: Thin main_vg-thin_pool-tpool is now 100% full.
Mar 26 07:41:21 node01 kernel: device-mapper: thin: 253:4: no free space available.
Mar 26 07:41:21 node01 lvm[2230]: Extending logical volume thin_pool to 156.00 MiB
Mar 26 07:41:21 node01 lvm[2230]: Number of extents requested (7) needs to be divisible by 2.
Mar 26 07:41:21 node01 lvm[2230]: Failed to extend thin main_vg-thin_pool-tpool.



Expected results:

thin pool LV should get increased automatically when --use-policies is provided. 
The rounding up of increase of space should be divisible by 2. 

Additional info:
Comment 3 Zdenek Kabelac 2012-03-26 09:02:55 EDT
Yep, there is missing piece of code to properly extend striped LVs
Comment 4 Zdenek Kabelac 2012-04-11 09:06:36 EDT
Updated with patches:

https://www.redhat.com/archives/lvm-devel/2012-April/msg00007.html
https://www.redhat.com/archives/lvm-devel/2012-April/msg00008.html
https://www.redhat.com/archives/lvm-devel/2012-April/msg00009.html
https://www.redhat.com/archives/lvm-devel/2012-April/msg00010.html

Patches are using better logic for rounding when stripes are in the game,
yet a further tunning here might be needed for some specific cases.

But the observed problem from this bugzilla should now work properly.
Comment 7 Peter Rajnoha 2012-04-12 09:39:31 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No documentation needed.
Comment 8 Nenad Peric 2012-04-24 07:46:46 EDT
the auto-extend works without errors 
tested with:

lvm2-2.02.95-5.el6.x86_64
Comment 9 errata-xmlrpc 2012-06-20 11:03:12 EDT
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-2012-0962.html

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