Bug 806885 - lvextend fails to extend striped thin volume with --use-policies
Summary: lvextend fails to extend striped thin volume with --use-policies
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Zdenek Kabelac
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-26 12:36 UTC by Nenad Peric
Modified: 2012-06-20 15:03 UTC (History)
10 users (show)

Fixed In Version: lvm2-2.02.95-4.el6
Doc Type: Bug Fix
Doc Text:
No documentation needed.
Clone Of:
Environment:
Last Closed: 2012-06-20 15:03:12 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2012:0962 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2012-06-19 21:12:11 UTC

Description Nenad Peric 2012-03-26 12:36:38 UTC
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 13:02:55 UTC
Yep, there is missing piece of code to properly extend striped LVs

Comment 4 Zdenek Kabelac 2012-04-11 13:06:36 UTC
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 13:39:31 UTC
    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 11:46:46 UTC
the auto-extend works without errors 
tested with:

lvm2-2.02.95-5.el6.x86_64

Comment 9 errata-xmlrpc 2012-06-20 15:03:12 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-2012-0962.html


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