RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1796683 - lvm unable to deal with splitting or removal of writecache volumes who's origin volumes are stacked
Summary: lvm unable to deal with splitting or removal of writecache volumes who's orig...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: 8.0
Assignee: LVM and device-mapper development team
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-30 23:22 UTC by Corey Marthaler
Modified: 2021-09-07 11:53 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-28 16:59:23 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-33881 0 None None None 2021-09-07 11:53:35 UTC
Red Hat Product Errata RHEA-2020:1881 0 None None None 2020-04-28 16:59:37 UTC

Description Corey Marthaler 2020-01-30 23:22:15 UTC
Description of problem:

# Create a raid1 for the origin volume

[root@hayes-02 ~]# lvcreate  --type raid1 -m 1 -L 4G -n display_writecache writecache_sanity /dev/sdm1 /dev/sdn1
  Logical volume "display_writecache" created.
[root@hayes-02 ~]# lvcreate  -L 4G -n pool writecache_sanity /dev/sdp1
  Logical volume "pool" created.

[root@hayes-02 ~]# lvs -a -o +devices
  LV                            VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                                      
  display_writecache            writecache_sanity rwi-a-r--- 4.00g                                    100.00           display_writecache_rimage_0(0),display_writecache_rimage_1(0)
  [display_writecache_rimage_0] writecache_sanity iwi-aor--- 4.00g                                                     /dev/sdm1(1)                                                 
  [display_writecache_rimage_1] writecache_sanity iwi-aor--- 4.00g                                                     /dev/sdn1(1)                                                 
  [display_writecache_rmeta_0]  writecache_sanity ewi-aor--- 4.00m                                                     /dev/sdm1(0)                                                 
  [display_writecache_rmeta_1]  writecache_sanity ewi-aor--- 4.00m                                                     /dev/sdn1(0)                                                 
  pool                          writecache_sanity -wi-a----- 4.00g                                                     /dev/sdp1(0)                                                 


[root@hayes-02 ~]# lvchange -an writecache_sanity
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachesettings 'writeback_jobs=1627 autocommit_blocks=2679 autocommit_time=2092' --cachevol writecache_sanity/pool writecache_sanity/display_writecache
  Logical volume writecache_sanity/display_writecache now has write cache.
[root@hayes-02 ~]# lvchange -ay writecache_sanity
[root@hayes-02 ~]# lvs -a -o +devices,segtype
  LV                            VG                Attr       LSize Pool        Origin                      Data%  Meta%  Move Log Cpy%Sync Convert Devices                                                       Type      
  display_writecache            writecache_sanity Cwi-a-C--- 4.00g [pool_cvol] [display_writecache_wcorig]                                         display_writecache_wcorig(0)                                  writecache
  [display_writecache_rimage_0] writecache_sanity iwi-aor--- 4.00g                                                                                 /dev/sdm1(1)                                                  linear    
  [display_writecache_rimage_1] writecache_sanity iwi-aor--- 4.00g                                                                                 /dev/sdn1(1)                                                  linear    
  [display_writecache_rmeta_0]  writecache_sanity ewi-aor--- 4.00m                                                                                 /dev/sdm1(0)                                                  linear    
  [display_writecache_rmeta_1]  writecache_sanity ewi-aor--- 4.00m                                                                                 /dev/sdn1(0)                                                  linear    
  [display_writecache_wcorig]   writecache_sanity rwi-aoC--- 4.00g                                                                100.00           display_writecache_rimage_0(0),display_writecache_rimage_1(0) raid1     
  [pool_cvol]                   writecache_sanity Cwi-aoC--- 4.00g                                                                                 /dev/sdp1(0)                                                  linear    

[root@hayes-02 ~]# lvchange -an writecache_sanity

# Split attempt
[root@hayes-02 ~]# lvconvert --splitcache writecache_sanity/display_writecache
  Cannot rename "display_writecache_wcorig": name format not recognized for internal LV "display_writecache_rimage_0"
  Failed to detach writecache from writecache_sanity/display_writecache

# Remove attempt
[root@hayes-02 ~]# lvremove -f writecache_sanity/display_writecache
  Cannot rename "display_writecache_wcorig": name format not recognized for internal LV "display_writecache_rimage_0"
  Failed to detach writecache from writecache_sanity/display_writecache
  Failed to detach writecache from writecache_sanity/display_writecache


Version-Release number of selected component (if applicable):
kernel-4.18.0-173.el8    BUILT: Fri Jan 24 06:02:03 CST 2020
lvm2-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
lvm2-libs-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
lvm2-dbusd-2.03.07-1.el8    BUILT: Mon Dec  2 00:12:23 CST 2019
lvm2-lockd-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
boom-boot-1.0-1.el8    BUILT: Fri Nov 29 05:18:30 CST 2019
device-mapper-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019


How reproducible:
Everytime

Comment 1 David Teigland 2020-02-04 21:14:08 UTC
The problem seems to be related to this bit of code in remove_layer_from_lv() which I do not understand:

        /*
         * recuresively rename sub LVs
         *   currently supported only for thin data layer
         *   FIXME: without strcmp it breaks mirrors....
         */
        if (!strstr(layer_lv->name, "_mimage"))
                for (r = 0; r < DM_ARRAY_SIZE(_suffixes); ++r)
                        if (strstr(layer_lv->name, _suffixes[r]) == 0) {
                                lv_names.old = layer_lv->name;
                                lv_names.new = parent_lv->name;
                                if (!for_each_sub_lv(parent_lv, _rename_skip_pools_externals_cb, (void *) &lv_names))
                                        return_0;
                                break;
                        }


That hunk of code ends up trying to incorrectly rename raid images based on the wcorig layer being removed.  If I simply remove that hunk of code the splitcache command works fine.  So the question is what the purpose of that code is, and how it should be properly disabled in this case.

Comment 2 David Teigland 2020-02-04 22:15:26 UTC
> The problem seems to be related to this bit of code in remove_layer_from_lv

Not a problem, it seems that I was using some old code to test, sorry for the noise.


fix in master
https://sourceware.org/git/?p=lvm2.git;a=commit;h=2a6078f96168e860474b42c42b1924fc353c4558


[root@null-05 lvm.git]# lvs -a foo
  LV              VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  fast            foo -wi-------  64.00m                                                    
  main            foo rwi---r--- 128.00m                                                    
  [main_rimage_0] foo Iwi---r--- 128.00m                                                    
  [main_rimage_1] foo Iwi---r--- 128.00m                                                    
  [main_rmeta_0]  foo ewi---r---   4.00m                                                    
  [main_rmeta_1]  foo ewi---r---   4.00m                                                    

[root@null-05 lvm.git]# lvconvert --type writecache --cachevol fast foo/main
Erase all existing data on foo/fast? [y/n]: y
  Logical volume foo/main now has write cache.

[root@null-05 lvm.git]# lvs -a foo
  LV                     VG  Attr       LSize   Pool        Origin        Data%  Meta%  Move Log Cpy%Sync Convert
  [fast_cvol]            foo Cwi---C---  64.00m                                                                  
  main                   foo Cwi---C--- 128.00m [fast_cvol] [main_wcorig]                                        
  [main_wcorig]          foo rwi---C--- 128.00m                                                                  
  [main_wcorig_rimage_0] foo Iwi---r--- 128.00m                                                                  
  [main_wcorig_rimage_1] foo Iwi---r--- 128.00m                                                                  
  [main_wcorig_rmeta_0]  foo ewi---r---   4.00m                                                                  
  [main_wcorig_rmeta_1]  foo ewi---r---   4.00m                                                                  

[root@null-05 lvm.git]# lvconvert --splitcache foo/main
  Logical volume foo/main write cache has been detached.

[root@null-05 lvm.git]# lvs -a foo
  LV              VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  fast            foo -wi-------  64.00m                                                    
  main            foo rwi---r--- 128.00m                                                    
  [main_rimage_0] foo Iwi---r--- 128.00m                                                    
  [main_rimage_1] foo Iwi---r--- 128.00m                                                    
  [main_rmeta_0]  foo ewi---r---   4.00m                                                    
  [main_rmeta_1]  foo ewi---r---   4.00m

Comment 4 Corey Marthaler 2020-02-20 21:02:34 UTC
Fixed verified in the latest rpms.

kernel-4.18.0-179.el8    BUILT: Fri Feb 14 17:03:01 CST 2020
lvm2-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
lvm2-libs-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
lvm2-dbusd-2.03.08-1.el8    BUILT: Tue Feb 11 07:42:51 CST 2020
lvm2-lockd-2.03.08-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-libs-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-event-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020
device-mapper-event-libs-1.02.169-1.el8    BUILT: Tue Feb 11 07:40:33 CST 2020


[root@hayes-02 ~]# lvcreate  --type raid1 -m 1 -L 4G -n display_writecache writecache_sanity /dev/sdm1 /dev/sdn1
  Logical volume "display_writecache" created.
[root@hayes-02 ~]# lvcreate  -L 4G -n pool writecache_sanity /dev/sdp1
  Logical volume "pool" created.
[root@hayes-02 ~]# lvs -a -o +devices
  LV                            VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices                                      
  display_writecache            writecache_sanity rwi-a-r--- 4.00g                                    100.00           display_writecache_rimage_0(0),display_writec
  [display_writecache_rimage_0] writecache_sanity iwi-aor--- 4.00g                                                     /dev/sdm1(1)                                 
  [display_writecache_rimage_1] writecache_sanity iwi-aor--- 4.00g                                                     /dev/sdn1(1)                                 
  [display_writecache_rmeta_0]  writecache_sanity ewi-aor--- 4.00m                                                     /dev/sdm1(0)                                 
  [display_writecache_rmeta_1]  writecache_sanity ewi-aor--- 4.00m                                                     /dev/sdn1(0)                                 
  pool                          writecache_sanity -wi-a----- 4.00g                                                     /dev/sdp1(0)                                 
[root@hayes-02 ~]# lvchange -an writecache_sanity
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachesettings 'writeback_jobs=1627 autocommit_blocks=2679 autocommit_time=2092' --cachevol writecache_sanity/
  Logical volume writecache_sanity/display_writecache now has write cache.
[root@hayes-02 ~]# lvchange -ay writecache_sanity
[root@hayes-02 ~]# lvs -a -o +devices,segtype
  LV                                   VG                Attr       LSize Pool        Origin                      Data%   Cpy%Sync Devices                          
  display_writecache                   writecache_sanity Cwi-a-C--- 4.00g [pool_cvol] [display_writecache_wcorig] 0.00             display_writecache_wcorig(0)     
  [display_writecache_wcorig]          writecache_sanity rwi-aoC--- 4.00g                                                 100.00   display_writecache_wcorig_rimage_
  [display_writecache_wcorig_rimage_0] writecache_sanity iwi-aor--- 4.00g                                                          /dev/sdm1(1)                     
  [display_writecache_wcorig_rimage_1] writecache_sanity iwi-aor--- 4.00g                                                          /dev/sdn1(1)                     
  [display_writecache_wcorig_rmeta_0]  writecache_sanity ewi-aor--- 4.00m                                                          /dev/sdm1(0)                     
  [display_writecache_wcorig_rmeta_1]  writecache_sanity ewi-aor--- 4.00m                                                          /dev/sdn1(0)                     
  [pool_cvol]                          writecache_sanity Cwi-aoC--- 4.00g                                                          /dev/sdp1(0)                     
[root@hayes-02 ~]# lvchange -an writecache_sanity

# Split attempt
[root@hayes-02 ~]# lvconvert --splitcache writecache_sanity/display_writecache
  Logical volume writecache_sanity/display_writecache write cache has been detached.
[root@hayes-02 ~]# echo $?
0

[root@hayes-02 ~]# lvcreate  --type raid1 -m 1 -L 4G -n display_writecache writecache_sanity /dev/sdm1 /dev/sdn1
  Logical Volume "display_writecache" already exists in volume group "writecache_sanity"
[root@hayes-02 ~]# lvs
  LV                 VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  display_writecache writecache_sanity rwi---r--- 4.00g                                                    
  pool               writecache_sanity -wi------- 4.00g                                                    
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachesettings 'writeback_jobs=1627 autocommit_blocks=2679 autocommit_time=2092' --cachevol writecache_sanity/
  Logical volume writecache_sanity/display_writecache now has write cache.

# Remove attempt
[root@hayes-02 ~]# lvremove -f writecache_sanity/display_writecache
  Logical volume "pool_cvol" successfully removed
  Logical volume "display_writecache" successfully removed
[root@hayes-02 ~]# echo $?
0

Comment 6 errata-xmlrpc 2020-04-28 16:59:23 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://access.redhat.com/errata/RHEA-2020:1881


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