Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1805898

Summary: allow writecache to be removed from an active LV
Product: Red Hat Enterprise Linux 8 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, pasik, prajnoha, zkabelac
Version: 8.4Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.03.09-3.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 02:00:25 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:

Description David Teigland 2020-02-21 17:17:36 UTC
Description of problem:

Currently the LV must be inactive before lvconvert --splitcache|--uncache can be used.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 5 Corey Marthaler 2020-07-20 22:10:13 UTC
Fix verified in the latest rpms.

kernel-4.18.0-215.el8    BUILT: Tue Jun 16 14:14:53 CDT 2020
lvm2-2.03.09-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
lvm2-libs-2.03.09-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
lvm2-dbusd-2.03.09-3.el8    BUILT: Mon Jun 29 13:53:38 CDT 2020
device-mapper-1.02.171-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
device-mapper-libs-1.02.171-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
device-mapper-event-1.02.171-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
device-mapper-event-libs-1.02.171-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020



[root@hayes-01 ~]# lvcreate --wipesignatures y  -L 4G -n split_cache writecache_sanity @slow
  Logical volume "split_cache" created.
[root@hayes-01 ~]# lvcreate --wipesignatures y  -L 4G -n un_cache writecache_sanity @slow
  Logical volume "un_cache" created.
[root@hayes-01 ~]# lvcreate  -L 4G -n pool1 writecache_sanity @fast
  Logical volume "pool1" created.
[root@hayes-01 ~]# lvcreate  -L 4G -n pool2 writecache_sanity @fast
  Logical volume "pool2" created.

[root@hayes-01 ~]# lvchange -an writecache_sanity/pool1  writecache_sanity/pool2
[root@hayes-01 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool1 writecache_sanity/split_cache
  Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 512.
  Logical volume writecache_sanity/split_cache now has writecache.
[root@hayes-01 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool2 writecache_sanity/un_cache
  Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 512.
  Logical volume writecache_sanity/un_cache now has writecache.
[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV                   VG                Attr       LSize Pool         Origin               Data%  Meta%  Move Log Cpy%Sync Convert Devices               Type      
  [pool1_cvol]         writecache_sanity Cwi-aoC--- 4.00g                                                                           /dev/sdi1(0)          linear    
  [pool2_cvol]         writecache_sanity Cwi-aoC--- 4.00g                                                                           /dev/sdi1(1024)       linear    
  split_cache          writecache_sanity Cwi-a-C--- 4.00g [pool1_cvol] [split_cache_wcorig] 0.00                                    split_cache_wcorig(0) writecache
  [split_cache_wcorig] writecache_sanity owi-aoC--- 4.00g                                                                           /dev/sdh1(0)          linear    
  un_cache             writecache_sanity Cwi-a-C--- 4.00g [pool2_cvol] [un_cache_wcorig]    0.00                                    un_cache_wcorig(0)    writecache
  [un_cache_wcorig]    writecache_sanity owi-aoC--- 4.00g                                                                           /dev/sdh1(1024)       linear    


# active splitcache
[root@hayes-01 ~]# lvconvert --splitcache writecache_sanity/split_cache
  Logical volume writecache_sanity/split_cache writecache has been detached.

# active uncache
[root@hayes-01 ~]# lvconvert --uncache writecache_sanity/un_cache
  Logical volume writecache_sanity/un_cache writecache has been detached.
  Logical volume "pool2" successfully removed

[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV          VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices         Type  
  pool1       writecache_sanity -wi------- 4.00g                                                     /dev/sdi1(0)    linear
  split_cache writecache_sanity -wi-a----- 4.00g                                                     /dev/sdh1(0)    linear
  un_cache    writecache_sanity -wi-a----- 4.00g                                                     /dev/sdh1(1024) linear

Comment 8 errata-xmlrpc 2020-11-04 02:00:25 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 (lvm2 bug fix and enhancement update), 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/RHBA-2020:4546