Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 806885

Summary: lvextend fails to extend striped thin volume with --use-policies
Product: Red Hat Enterprise Linux 6 Reporter: Nenad Peric <nperic>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED ERRATA QA Contact: Cluster QE <mspqa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3CC: agk, dwysocha, heinzm, jbrassow, mbroz, msnitzer, prajnoha, prockai, thornber, zkabelac
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 15:03:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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