This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1299061 - lvs seg_pe_ranges incorrect for RAID LV
lvs seg_pe_ranges incorrect for RAID LV
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
23
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Alasdair Kergon
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-15 15:47 EST by Tony Asleson
Modified: 2016-08-01 05:17 EDT (History)
12 users (show)

See Also:
Fixed In Version: lvm2-2.02.150-2.fc24.x86_64
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-01 05:17:52 EDT
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)
ouput from -vvvv (32.14 KB, text/plain)
2016-01-15 17:03 EST, Tony Asleson
no flags Details

  None (edit)
Description Tony Asleson 2016-01-15 15:47:03 EST
Description of problem:

The seg_pe_ranges are incorrect for a RAID LV.

# lvs -a -o name,seg_pe_ranges
  LV              PE Ranges
  [lvol0_pmspare] /dev/sdb:129-129
  r5              r5_rimage_0:0-255 r5_rimage_1:0-255 r5_rimage_2:0-255
  [r5_rimage_0]   /dev/sdb:1-128
  [r5_rimage_1]   /dev/sdc:1-128
  [r5_rimage_2]   /dev/sdd:2-129
  [r5_rmeta_0]    /dev/sdb:0-0
  [r5_rmeta_1]    /dev/sdc:0-0
  [r5_rmeta_2]    /dev/sdd:1-1
  tp              tp_tdata:0-255
  [tp_tdata]      /dev/sdb:130-385
  [tp_tmeta]      /dev/sde:0-0

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

How reproducible:
Always

Steps to Reproduce:
1. Create a raid5 LV (lvcreate --size 1G --type raid5 -n testing some_vg
2. Query LV (lvs -a -o name,seg_pe_ranges)

Actual results:
see above

Expected results:

For this specific case we would expect:
r5              r5_rimage_0:0-127 r5_rimage_1:0-127 r5_rimage_2:0-127

Additional info:
Comment 1 Tony Asleson 2016-01-15 17:00:20 EST
LVM version:     2.02.132(2) (2015-09-22)
Library version: 1.02.115-git (2015-12-14)
Driver version:  4.33.0
Comment 2 Tony Asleson 2016-01-15 17:03 EST
Created attachment 1115300 [details]
ouput from -vvvv

I didn't have the same configuration when I collected this debug, but the issue is the same, just different values.
Comment 3 Alasdair Kergon 2016-01-15 17:25:59 EST
It's 132.  Before looking at this any further, please try to reproduce on a newer release.  (This code was touched in release 133 - let's at least eliminate those changes.)
Comment 4 Tony Asleson 2016-01-15 17:32:12 EST
[root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm version
  LVM version:     2.02.139(2)-git (2015-12-14)
  Library version: 1.02.115-git (2015-12-14)
  Driver version:  4.33.0
[root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm lvcreate -L1G --type raid5 -n r5 test
  Rounding size 1.00 GiB (256 extents) up to stripe boundary size 1.01 GiB (258 extents).
  Logical volume "r5" created.   
[root@localhost lvm-dubstep]# /home/tasleson/projects/lvm2/tools/lvm lvs -a -o name,seg_pe_ranges
  LV            PE Ranges                                                              
  r5            r5_rimage_0:0-257 r5_rimage_1:0-257 r5_rimage_2:0-257 r5_rimage_3:0-257
  [r5_rimage_0] /dev/sdb:1-86                                                          
  [r5_rimage_1] /dev/sdc:1-86                                                          
  [r5_rimage_2] /dev/sdd:1-86                                                          
  [r5_rimage_3] /dev/sde:1-86                                                          
  [r5_rmeta_0]  /dev/sdb:0-0                                                           
  [r5_rmeta_1]  /dev/sdc:0-0                                                           
  [r5_rmeta_2]  /dev/sdd:0-0                                                           
  [r5_rmeta_3]  /dev/sde:0-0   

Is this new enough?
Comment 5 Alasdair Kergon 2016-01-18 17:12:29 EST
It was reporting the size of the segment - which is correct for a PV but not necessarily correct when stacked over an LV.
I've changed this to report the size of the LV underneath.

https://www.redhat.com/archives/lvm-devel/2016-January/msg00067.html
https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=a3f484f812bfb89063fbc25e378f34cacd50bf7d

But I've not tested this thoroughly and perhaps there still exist some other stacks where this is wrong.
Comment 6 Zdenek Kabelac 2016-01-19 03:33:02 EST
IMHO such function should always report  PE ranges.

Names of LV are not really PE - so the reporting function should be simply
calculating join set of PE ranges  (as the name of field suggest)

Currently reported LV name in this field is IMHO plain bug.
Comment 7 Tony Asleson 2016-01-19 14:28:18 EST
(In reply to Zdenek Kabelac from comment #6)
> IMHO such function should always report  PE ranges.
> 
> Names of LV are not really PE - so the reporting function should be simply
> calculating join set of PE ranges  (as the name of field suggest)
> 
> Currently reported LV name in this field is IMHO plain bug.

I agree with this.  

seg_pe_ranges = "Ranges of Physical Extents of underlying devices in command line format."

Additionally, the PE Ranges when expressed as LV ranges only list those areas that are data areas which don't include the metadata area, thus it's incomplete.
Comment 8 Mike McCune 2016-03-28 18:11:59 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions

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