Bug 1248796 - --select fails to grab cache origin volume when that cache origin volume is a thin pool
--select fails to grab cache origin volume when that cache origin volume is a...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: lvm2 (Show other bugs)
7.2
x86_64 Linux
low Severity low
: rc
: ---
Assigned To: Peter Rajnoha
cluster-qe@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-07-30 16:52 EDT by Corey Marthaler
Modified: 2015-07-31 05:15 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-07-31 05:15:59 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)

  None (edit)
Description Corey Marthaler 2015-07-30 16:52:05 EDT
Description of problem:
This is a pretty low priority issue, but I came across it when running through the matrix of volumes that can be cached.


[root@host-110 ~]# vgcreate vg /dev/sd[abcdefgh]1
  Volume group "vg" successfully created

[root@host-110 ~]# lvcreate -n pool -L 500M vg /dev/sdf1
  Logical volume "pool" created.
[root@host-110 ~]# lvcreate -n meta -L 50M vg /dev/sdg1
  Rounding up size to full physical extent 52.00 MiB
  Logical volume "meta" created.
[root@host-110 ~]# lvconvert --yes --type cache-pool --poolmetadata vg/meta vg/pool
  WARNING: Converting logical volume vg/pool and vg/meta to pool's data and metadata volumes.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
  Converted vg/pool to cache pool.

[root@host-110 ~]# lvs -a -o +devices
  LV              VG  Attr       LSize   Pool Origin Data%  Meta% Cpy%Sync Devices
  [lvol0_pmspare] vg  ewi-------  52.00m                                   /dev/sda1(0)
  pool            vg  Cwi---C--- 500.00m                                   pool_cdata(0)
  [pool_cdata]    vg  Cwi------- 500.00m                                   /dev/sdf1(0)
  [pool_cmeta]    vg  ewi-------  52.00m                                   /dev/sdg1(0)

[root@host-110 ~]# lvcreate --thinpool corigin -L 500M --poolmetadatasize 50M vg /dev/sdh1
  Rounding up size to full physical extent 52.00 MiB
  Logical volume "corigin" created.

[root@host-110 ~]# lvconvert --yes --type cache --cachepool vg/pool vg/corigin
  Logical volume vg/corigin_tdata is now cached.
[root@host-110 ~]# lvs -a -o +devices
  LV                    VG  Attr       LSize   Pool   Origin                Data%  Meta% Cpy%Sync Devices
  corigin               vg  twi-a-tz-- 500.00m                              0.00   0.07           corigin_tdata(0)
  [corigin_tdata]       vg  Cwi-aoC--- 500.00m [pool] [corigin_tdata_corig] 0.00   0.17  100.00   corigin_tdata_corig(0)
  [corigin_tdata_corig] vg  owi-aoC--- 500.00m                                                    /dev/sdh1(0)
  [corigin_tmeta]       vg  ewi-ao----  52.00m                                                    /dev/sdh1(125)
  [lvol0_pmspare]       vg  ewi-------  52.00m                                                    /dev/sda1(0)
  [pool]                vg  Cwi---C--- 500.00m                              0.00   0.17  100.00   pool_cdata(0)
  [pool_cdata]          vg  Cwi-ao---- 500.00m                                                    /dev/sdf1(0)
  [pool_cmeta]          vg  ewi-ao----  52.00m                                                    /dev/sdg1(0)
[root@host-110 ~]# lvs -o lv_name --select 'pool_lv=pool'
[root@host-110 ~]# 



Version-Release number of selected component (if applicable):
3.10.0-296.el7.x86_64
lvm2-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-libs-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
lvm2-cluster-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-event-libs-1.02.102-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
device-mapper-persistent-data-0.5.4-1.el7    BUILT: Fri Jul 17 08:56:22 CDT 2015
cmirror-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
sanlock-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
sanlock-lib-3.2.4-1.el7    BUILT: Fri Jun 19 12:48:49 CDT 2015
lvm2-lockd-2.02.125-2.el7    BUILT: Fri Jul 10 03:42:29 CDT 2015
Comment 1 Peter Rajnoha 2015-07-31 02:17:08 EDT
That's because the pool lv is in this case marked as internal LV [pool] (with the brackets) - I've got a patch which is a part of another patchset on my devel branch that deals with this (though for string list types, not for string type alone, but I'll do that for string types too) and when doing the comparison, it ignores the [] decoration (or any other possible registered decoration).
Comment 2 Peter Rajnoha 2015-07-31 04:50:35 EDT
(In reply to Corey Marthaler from comment #0)
> [root@host-110 ~]# lvs -o lv_name --select 'pool_lv=pool'
> [root@host-110 ~]# 

I've checked this - actually we do report "[blabla]" on output, but still the raw value is "blabla" which makes it selectable just fine (as raw values are used for selection).

You just missed the "-a" for your lvs - the selection is done on the list that would be reported normally and without "-a" the [corigin_tdata] is hidden. 

# lvs -o lv_name -S 'pool_lv=pool'
(nothing)

#lvs -a -o lv_name -S 'pool_lv=pool'
  LV             
  [corigin_tdata]

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