Bug 1105332

Summary: need a more graceful error when lv is not a cache pool
Product: Red Hat Enterprise Linux 7 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Petr Rockai <prockai>
lvm2 sub component: Cache Logical Volumes QA Contact: Cluster QE <mspqa-list>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: medium CC: agk, heinzm, jbrassow, msnitzer, nperic, ovasik, prajnoha, prockai, zkabelac
Version: 7.0Keywords: Triaged
Target Milestone: rc   
Target Release: 7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.112-1.el7 Doc Type: Bug Fix
Doc Text:
Some invocations of lvconvert referring to a cache pool LV that was of the wrong type could trigger an internal error. To remedy the problem, lvconvert now offers to convert the LV to a cache pool and when declined, cleanly aborts the operation.
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:08:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1119326    

Description Corey Marthaler 2014-06-05 22:07:16 UTC
Description of problem:

[root@host-073 ~]# lvs -a -o +devices
  LV   VG   Attr       LSize   Pool Origin Devices       
  lv   vg   -wi-a----- 100.00m             /dev/sda1(0)  
[root@host-073 ~]# lvcreate --virtualsize 100M -T vg/lv -n virt
  Logical volume lv is not a thin pool.


[root@host-034 ~]# lvs -a -o +devices
  LV      VG            Attr       LSize   Pool Origin Devices       
  corigin cache_sanity  -wi-a-----   2.00g             /dev/sdh1(0)  
  pool    cache_sanity  -wi-a----- 100.00m             /dev/sdf1(0)  
[root@host-034 ~]# lvconvert --type cache --cachepool cache_sanity/pool cache_sanity/corigin
  Internal error: pool is not a cache_pool LV


Version-Release number of selected component (if applicable):
3.10.0-123.el7.x86_64
lvm2-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-libs-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
lvm2-cluster-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-event-libs-1.02.84-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014
device-mapper-persistent-data-0.3.2-1.el7    BUILT: Thu Apr  3 09:58:51 CDT 2014
cmirror-2.02.105-14.el7    BUILT: Wed Mar 26 08:29:41 CDT 2014

Comment 2 Alasdair Kergon 2014-06-05 22:33:58 UTC
Yes - that should have been trapped cleanly before encountering that internal error.

Comment 3 Petr Rockai 2014-10-06 06:01:34 UTC
This no longer happens with current upstream code: lvconvert instead offers to convert the LV to a cachepool and when declined, cleanly aborts the operation.

Comment 6 Nenad Peric 2014-11-21 14:09:38 UTC
The behavior noticed with version 112-1 is as described in Comment #3:

[root@virt-133 tests]# lvconvert --type cache --cachepool vg/pool vg/corigin
  WARNING: Converting logical volume vg/pool to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vg/pool? [y/n]: n
  Conversion aborted.
[root@virt-133 tests]# lvs -a
  LV      VG            Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root    rhel_virt-133 -wi-ao----   6.67g                                                    
  swap    rhel_virt-133 -wi-ao---- 820.00m                                                    
  corigin vg            -wi-a-----   2.00g                                                    
  lv      vg            -wi-a-----   1.00g                                                    
  pool    vg            -wi-a-----   1.00g                                                    
[root@virt-133 tests]# lvconvert --type cache --cachepool vg/pool vg/corigin
  WARNING: Converting logical volume vg/pool to pool's data volume.
  THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.)
Do you really want to convert vg/pool? [y/n]: y
  Converted vg/pool to cache pool.
  Logical volume vg/corigin is now cached.
[root@virt-133 tests]# lvs -a
  LV              VG            Attr       LSize   Pool   Origin          Data%  Meta%  Move Log Cpy%Sync Convert
  root            rhel_virt-133 -wi-ao----   6.67g                                                               
  swap            rhel_virt-133 -wi-ao---- 820.00m                                                               
  corigin         vg            Cwi-a-C---   2.00g [pool] [corigin_corig] 0.04   1.90            0.00            
  [corigin_corig] vg            owi-aoC---   2.00g                                                               
  lv              vg            -wi-a-----   1.00g                                                               
  [lvol0_pmspare] vg            ewi-------   8.00m                                                               
  [pool]          vg            Cwi---C---   1.00g                        0.04   1.90            0.00            
  [pool_cdata]    vg            Cwi-ao----   1.00g                                                               
  [pool_cmeta]    vg            ewi-ao----   8.00m                                                               
[root@virt-133 tests]# 


Marking the BZ as VERIFIED with:


lvm2-2.02.112-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
lvm2-libs-2.02.112-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
lvm2-cluster-2.02.112-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
device-mapper-1.02.91-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
device-mapper-libs-1.02.91-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
device-mapper-event-1.02.91-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
device-mapper-event-libs-1.02.91-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014
device-mapper-persistent-data-0.4.1-2.el7    BUILT: Wed Nov 12 19:39:46 CET 2014
cmirror-2.02.112-1.el7    BUILT: Tue Nov 11 16:39:35 CET 2014

Comment 8 errata-xmlrpc 2015-03-05 13:08:49 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.

https://rhn.redhat.com/errata/RHBA-2015-0513.html