Bug 1853471

Summary: origin is now allowed to be online and active during conversion to writecache
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: high CC: agk, heinzm, jbrassow, mcsontos, msnitzer, pasik, prajnoha, teigland, zkabelac
Version: 8.3Flags: pm-rhel: mirror+
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.11-0.2.20201103git8801a86.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:01:53 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 Corey Marthaler 2020-07-02 18:41:17 UTC
Description of problem:
QA knew going fwd into 8.3 that active writecache restrictions would be lifted eventually, so this is not a huge surprise, however since i didn't see a BZ for this in the current build of the errata, I'm filing this to ensure that we can lift all inactive origin checks (a reversal of the checks required for 8.2 bug 1805532)?

[root@hayes-02 ~]# lvcreate --wipesignatures y  -L 4G -n cworigin writecache_sanity @slow
  Logical volume "cworigin" created.

[root@hayes-02 ~]# mkfs.xfs /dev/writecache_sanity/cworigin 
[root@hayes-02 ~]# mount /dev/writecache_sanity/cworigin /mnt
[root@hayes-02 ~]# df -h
Filesystem                              Size  Used Avail Use% Mounted on
/dev/mapper/writecache_sanity-cworigin  4.0G   61M  4.0G   2% /mnt

[root@hayes-02 ~]# lvcreate  -L 1G -n dummy_pool writecache_sanity @fast
  Logical volume "dummy_pool" created.

# WC POOL volume is still required to be inactive
[root@hayes-02 ~]# lvconvert --yes --type writecache  --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  LV writecache_sanity/dummy_pool must be inactive to attach.

# WC ORIGIN volume is now allowed to be active and open
[root@hayes-02 ~]# lvchange -an writecache_sanity/dummy_pool
[root@hayes-02 ~]#  lvconvert --yes --type writecache  --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  Using writecache block size 512 for unknown file system block size, logical block size 512, physical block size 512.
  Logical volume writecache_sanity/cworigin now has writecache.




Version-Release number of selected component (if applicable):
kernel-4.18.0-211.el8    BUILT: Thu Jun  4 03:33:39 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
lvm2-lockd-2.03.09-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
boom-boot-1.2-1.el8    BUILT: Sun Jun  7 07:20:03 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

Comment 1 David Teigland 2020-07-02 19:01:33 UTC
bug 1630978 "LV sector size changes when attaching dm-writecache" is used to enable attaching a writecache to an active LV.  A mismatching sector size with the file system is the reason we had to originally disable the attachment while active.  We now have the ability to detect the correct fs block size which allows us to attach the writecache to an active LV.

Comment 2 Jonathan Earl Brassow 2020-07-15 06:00:59 UTC
Please check with corey to be sure he is ready for testing this.  May also want to remember to check release notes with Marek to ensure they do not contain stale information about writecache limitations.

Comment 5 Corey Marthaler 2020-11-12 23:22:18 UTC
Fix verified in the latest .d rpms.

kernel-4.18.0-246.el8.dt2    BUILT: Mon Nov  9 07:22:41 CST 2020
lvm2-2.03.11-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020
lvm2-libs-2.03.11-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020

device-mapper-1.02.175-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020
device-mapper-libs-1.02.175-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020
device-mapper-event-1.02.175-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020
device-mapper-event-libs-1.02.175-0.2.20201103git8801a86.el8    BUILT: Wed Nov  4 07:04:46 CST 2020

[root@hayes-01 ~]# df -h
Filesystem                              Size  Used Avail Use% Mounted on
/dev/mapper/writecache_sanity-cworigin  4.0G  421M  3.6G  11% /mnt/cworigin

[root@hayes-01 ~]# lvs -a -o +devices
  LV         VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  cworigin   writecache_sanity -wi-ao---- 4.00g                                                     /dev/sdj1(0)
  dummy_pool writecache_sanity -wi------- 1.00g                                                     /dev/sdd1(0)

[root@hayes-01 ~]# lvconvert --test --yes --type writecache --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Logical volume writecache_sanity/cworigin now has writecache.

[root@hayes-01 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  Logical volume writecache_sanity/cworigin now has writecache.

[root@hayes-01 ~]# lvs -a -o +devices,segtype
  LV                VG                Attr       LSize Pool              Origin            Data%  Convert Devices    Type      
  cworigin          writecache_sanity Cwi-aoC--- 4.00g [dummy_pool_cvol] [cworigin_wcorig] 0.00   cworigin_wcorig(0) writecache
  [cworigin_wcorig] writecache_sanity owi-aoC--- 4.00g                                            /dev/sdj1(0)       linear    
  [dummy_pool_cvol] writecache_sanity Cwi-aoC--- 1.00g                                            /dev/sdd1(0)       linear

Comment 10 Corey Marthaler 2021-01-08 22:25:28 UTC
Fix verified in the latest rpms.

kernel-4.18.0-271.el8    BUILT: Fri Jan  8 03:32:43 CST 2021
lvm2-2.03.11-0.4.20201222gitb84a992.el8    BUILT: Tue Dec 22 06:33:49 CST 2020
lvm2-libs-2.03.11-0.4.20201222gitb84a992.el8    BUILT: Tue Dec 22 06:33:49 CST 2020


[root@hayes-03 ~]# df -h
Filesystem                              Size  Used Avail Use% Mounted on
/dev/mapper/writecache_sanity-cworigin  4.0G  418M  3.6G  11% /mnt/cworigin

# Active pool attempt (should fail) with ONLINE origin
[root@hayes-03 ~]# lvs -a -o +devices
  LV         VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices    
  cworigin   writecache_sanity -wi-ao---- 4.00g                                                     /dev/sdp(0)
  dummy_pool writecache_sanity -wi-a----- 1.00g                                                     /dev/sdl(0)
[root@hayes-03 ~]# lvconvert --test --yes --type writecache --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  LV writecache_sanity/dummy_pool must be inactive to attach.


# Inactive pool attempt (should pass) with ONLINE origin
[root@hayes-03 ~]# lvchange -an writecache_sanity/dummy_pool
[root@hayes-03 ~]# lvs -a -o +devices
  LV         VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices    
  cworigin   writecache_sanity -wi-ao---- 4.00g                                                     /dev/sdp(0)
  dummy_pool writecache_sanity -wi------- 1.00g                                                     /dev/sdl(0)
[root@hayes-03 ~]# lvconvert --test --yes --type writecache --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Logical volume writecache_sanity/cworigin now has writecache.
[root@hayes-03 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/dummy_pool writecache_sanity/cworigin
  Logical volume writecache_sanity/cworigin now has writecache.
[root@hayes-03 ~]# lvs -a -o +devices,segtype
  LV                VG                Attr       LSize Pool              Origin            Data%  Meta%  Move Log Cpy%Sync Convert Devices            Type      
  cworigin          writecache_sanity Cwi-aoC--- 4.00g [dummy_pool_cvol] [cworigin_wcorig] 0.00                                    cworigin_wcorig(0) writecache
  [cworigin_wcorig] writecache_sanity owi-aoC--- 4.00g                                                                             /dev/sdp(0)        linear    
  [dummy_pool_cvol] writecache_sanity Cwi-aoC--- 1.00g                                                                             /dev/sdl(0)        linear

Comment 12 errata-xmlrpc 2021-05-18 15:01:53 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-2021:1659