Bug 1114078

Summary: need a more graceful error when attempting to cache an origin that is already cached
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Cache Logical Volumes (RHEL6) QA Contact: Cluster QE <mspqa-list>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, zkabelac
Version: 6.6   
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.02.111-1.el6 Doc Type: Bug Fix
Doc Text:
No text required - just error message improvement.
Story Points: ---
Clone Of: 1109974 Environment:
Last Closed: 2014-10-14 08:25:21 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: 1109974    
Bug Blocks:    

Comment 1 Corey Marthaler 2014-06-27 16:23:09 UTC
[root@host-001 ~]# lvs -a -o +devices
  LV                     Attr       LSize   Pool   Origin        Devices
  already_cached         Cwi-a-C---   4.00g pool_1 [already_cached_corig] already_cached_corig(0)
  [already_cached_corig] -wi-ao----   4.00g                      /dev/sde1(0)
  [lvol0_pmspare]        ewi-------   8.00m                      /dev/sda1(0)
  pool_1                 Cwi---C---   2.00g                      pool_1_cdata(0)
  [pool_1_cdata]         Cwi-aoC---   2.00g                      /dev/sdc1(0)
  [pool_1_cmeta]         ewi-aoC---   8.00m                      /dev/sdc1(512)
  pool_2                 Cwi---C---   2.00g                      pool_2_cdata(0)
  [pool_2_cdata]         Cwi---C---   2.00g                      /dev/sdc1(514)
  [pool_2_cmeta]         ewi---C---   8.00m                      /dev/sdc1(1026)

[root@host-001 ~]# lvconvert --type cache --cachepool cache_sanity/pool_2 cache_sanity/already_cached
  Internal error: The origin, already_cached, cannot be of cache type


2.6.32-485.el6.x86_64
lvm2-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
lvm2-libs-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
lvm2-cluster-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
udev-147-2.55.el6    BUILT: Wed Jun 18 06:30:21 CDT 2014
device-mapper-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-libs-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-event-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-event-libs-1.02.86-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.107-1.el6    BUILT: Mon Jun 23 09:44:45 CDT 2014

Comment 2 Jonathan Earl Brassow 2014-08-27 12:32:38 UTC
patch committed upstream:

commit 8b9eb95ea9d2a950286f622f6d2d571c76642654
Author: Jonathan Brassow <jbrassow>
Date:   Sun Aug 24 19:44:37 2014 -0500

    cache: Clean-up error message.
    
    It is not an internal error message to report to the user that they
    cannot create a cache LV on top of a cache LV.  It is simply not
    supported yet.

Comment 3 Marian Csontos 2014-08-27 13:18:47 UTC
with lvm2-2.02.110-0.41.el6.x86_64 I get meaningful:

+ lvconvert --yes --type cache --cachepool cache_sanity/pool_2 cache_sanity/already_cached
  Can't cache pool or cache type volume cache_sanity/already_cached.
++ ERR
++ echo ERROR: 5
ERROR: 5
++ exit 1

Comment 4 Peter Rajnoha 2014-08-27 13:26:10 UTC
(In reply to Marian Csontos from comment #3)
> with lvm2-2.02.110-0.41.el6.x86_64 I get meaningful:
> 

...this is nightly build, not the actual build in RHEL 6.6 - Jon's patch is not yet in! I'll include that in next rebuild.

Comment 6 Corey Marthaler 2014-09-03 20:43:42 UTC
Fixed verified in the latest rpms.

2.6.32-495.el6.x86_64
lvm2-2.02.111-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
lvm2-libs-2.02.111-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
lvm2-cluster-2.02.111-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
udev-147-2.57.el6    BUILT: Thu Jul 24 08:48:47 CDT 2014
device-mapper-1.02.90-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
device-mapper-libs-1.02.90-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
device-mapper-event-1.02.90-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
device-mapper-event-libs-1.02.90-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014
device-mapper-persistent-data-0.3.2-1.el6    BUILT: Fri Apr  4 08:43:06 CDT 2014
cmirror-2.02.111-2.el6    BUILT: Mon Sep  1 06:46:43 CDT 2014


Old version:
lvconvert --yes --type cache --cachepool cache_sanity/pool_2 cache_sanity/already_cached
  Internal error: The origin, already_cached, cannot be of cache type

New version:
lvconvert --yes --type cache --cachepool cache_sanity/pool_2 cache_sanity/already_cached
  Can't cache pool or cache type volume cache_sanity/already_cached.

Comment 7 errata-xmlrpc 2014-10-14 08:25:21 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-2014-1387.html