Bug 1104381

Summary: RAID cache: Removing cache logical volume prints stray error message
Product: Red Hat Enterprise Linux 6 Reporter: Jonathan Earl Brassow <jbrassow>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
lvm2 sub component: Default / Unclassified (RHEL6) QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, msnitzer, nperic, prajnoha, prockai, zkabelac
Version: 6.7   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.117-1.el6 Doc Type: Bug Fix
Doc Text:
Wrong order of removed device when lvremoving cached volume resulted into printing an error message 'device not found'. Order has been fixed and this error is no longer printed.
Story Points: ---
Clone Of:
: 1160903 (view as bug list) Environment:
Last Closed: 2015-07-22 07:37: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:    
Bug Blocks: 1119326, 1160903    
Attachments:
Description Flags
Possible patch to fix the problem none

Description Jonathan Earl Brassow 2014-06-03 21:18:08 UTC
Stray error message when removing cache LVs:

[root@bp-01 lvm2]# lvremove -ff vg
  Logical volume "lv" successfully removed
  Logical volume "lv_cachepool" successfully removed
[root@bp-01 lvm2]# lvcreate --type raid1 -L 10G -n lv vg
  Logical volume "lv" created
[root@bp-01 lvm2]# lvcreate --type cache -L 1G -n lv_cachepool vg/lv
  Logical volume "lvol0" created
  Logical volume "lv" created
[root@bp-01 lvm2]# devices vg
  LV                   Attr       Cpy%Sync Devices                      
  lv                   Cwi-a-C---          lv_corig(0)                  
  lv_cachepool         Cwi---C---          lv_cachepool_cdata(0)        
  [lv_cachepool_cdata] Cwi---C---          /dev/sdb1(2563)              
  [lv_cachepool_cmeta] ewi---C---          /dev/sdb1(2562)              
  [lv_corig]           rwi---r---          lv_rimage_0(0),lv_rimage_1(0)
  [lv_rimage_0]        Iwi-aor-r-          /dev/sdb1(1)                 
  [lv_rimage_1]        Iwi-aor-r-          /dev/sdc1(1)                 
  [lv_rmeta_0]         ewi-aor-r-          /dev/sdb1(0)                 
  [lv_rmeta_1]         ewi-aor-r-          /dev/sdc1(0)                 
  [lvol0_pmspare]      ewi-------          /dev/sdb1(2561)              
[root@bp-01 lvm2]# lvremove -ff vg
  _get_device_info: LVM-BZoTdH7D3PTVbFFWTvbrqYOiIfvgTMg74k3bVmYzhIEB8N1ncVbVmIu1AwAoPWbw: device not found
  Logical volume "lv" successfully removed
  Logical volume "lv_cachepool" successfully removed


I've bisected the code and found the problem to come from commit 8a60cbcf45c553dfc168552cf9af3059359ec95d.  Specifically, it seems the portion that was removed that relates to cache LVs is the problem.  I'll post my patch that reverses that portion (and fixes this bug), for someone with better knowledge to look it over.

Comment 1 Jonathan Earl Brassow 2014-06-03 21:19:33 UTC
Created attachment 901912 [details]
Possible patch to fix the problem

Comment 2 Jonathan Earl Brassow 2014-08-27 12:43:00 UTC
not a blocker candidate due to tech preview status

Comment 3 Zdenek Kabelac 2014-09-25 09:02:51 UTC
This case should be supported with upstream (at least I'm not seeing any fault on my git tree) - yet the fixes my be result of recent fixes - so not sure if all hits 6.6 build - anyway - please retests.

It's already fixed for 6.7.

Comment 4 Jonathan Earl Brassow 2014-10-01 19:39:34 UTC
seems to be fixed upstream - having this in POST is fine, but it would be nice to know what commit fixed the issue or at least if it was fixed in the .111 release of LVM.

Comment 6 Peter Rajnoha 2014-11-13 09:06:09 UTC
(In reply to Jonathan Earl Brassow from comment #4)
> seems to be fixed upstream - having this in POST is fine, but it would be
> nice to know what commit fixed the issue or at least if it was fixed in the
> .111 release of LVM.

...still reproducible in v111 (which is in RHEL 6.6), so this is fixed in v112, so this fix will appear in 6.7.

Comment 8 Nenad Peric 2015-04-23 09:56:42 UTC
Did not hit an issue with the stray message. Used the reproducer mentioned in the opening comment, added a thin pool into the mix as well:

[root@tardis-02 ~]# lvs -a
  LV                   VG          Attr       LSize   Pool           Origin     Data%  Meta%  Move Log Cpy%Sync Convert
  lv                   vg          Cwi-a-C---  10.00g [lv_cachepool] [lv_corig] 0.03   1.90            0.00            
  [lv_cachepool]       vg          Cwi---C---   1.00g                           0.03   1.90            0.00            
  [lv_cachepool_cdata] vg          Cwi-ao----   1.00g                                                                  
  [lv_cachepool_cmeta] vg          ewi-ao----   8.00m                                                                  
  [lv_corig]           vg          rwi-aoC---  10.00g                                                  13.28           
  [lv_corig_rimage_0]  vg          Iwi-aor---  10.00g                                                                  
  [lv_corig_rimage_1]  vg          Iwi-aor---  10.00g                                                                  
  [lv_corig_rmeta_0]   vg          ewi-aor---   4.00m                                                                  
  [lv_corig_rmeta_1]   vg          ewi-aor---   4.00m                                                                  
  [lvol0_pmspare]      vg          ewi-------   8.00m                                                                  
  pool                 vg          twi-a-tz--  10.00g                           0.00   1.17                            
  [pool_tdata]         vg          Twi-ao----  10.00g                                                                  
  [pool_tmeta]         vg          ewi-ao----   4.00m                                                                  
  lv_home              vg_tardis02 -wi-ao---- 224.88g                                                                  
  lv_root              vg_tardis02 -wi-ao----  50.00g                                                                  
  lv_swap              vg_tardis02 -wi-ao----   4.00g                                                                  


[root@tardis-02 ~]# lvremove -ff vg
  Logical volume "lv_cachepool" successfully removed
  Logical volume "lv" successfully removed
  Logical volume "pool" successfully removed


Marking as verified with lvm2-2.02.118-2.el6.x86_64

Comment 9 errata-xmlrpc 2015-07-22 07:37: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.

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