Bug 1800358

Summary: lvm --test mode doesn't work with writecache conversion attempts
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: LVM and device-mapper development team <lvm-team>
lvm2 sub component: Cache Logical Volumes QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: unspecified CC: agk, heinzm, jbrassow, mcsontos, msnitzer, pasik, prajnoha, teigland, zkabelac
Version: 8.2   
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.08-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:59:23 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-02-06 23:15:30 UTC
Description of problem:

[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  cworigin        writecache_sanity -wi-a----- 4.00g                                                     /dev/sdg1(0)
  test_writecache writecache_sanity -wi-a----- 2.00g                                                     /dev/sdf1(0)

[root@hayes-02 ~]# lvconvert --yes --test --type writecache --cachevol writecache_sanity/test_writecache writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  LV writecache_sanity/test_writecache must be inactive to attach.

[root@hayes-02 ~]# lvchange -an writecache_sanity
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  cworigin        writecache_sanity -wi------- 4.00g                                                     /dev/sdg1(0)
  test_writecache writecache_sanity -wi------- 2.00g                                                     /dev/sdf1(0)

[root@hayes-02 ~]# lvconvert --yes --test --type writecache --cachevol writecache_sanity/test_writecache writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Volume "writecache_sanity/test_writecache" is not active locally (volume_list activation filter?).
  LV writecache_sanity/test_writecache could not be zeroed.
[root@hayes-02 ~]# echo $?
5

# In reality this would have worked fine if attempted w/o --test mode
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/test_writecache writecache_sanity/cworigin
  Logical volume writecache_sanity/cworigin now has write cache.


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
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

Comment 2 Marian Csontos 2020-02-24 16:22:10 UTC
Corey, could you ack please?

Comment 5 Corey Marthaler 2020-02-24 21:06:40 UTC
Fix verified in the latest rpms.

kernel-4.18.0-179.el8    BUILT: Fri Feb 14 17:03:01 CST 2020
lvm2-2.03.08-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020
lvm2-libs-2.03.08-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020
device-mapper-1.02.169-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020
device-mapper-libs-1.02.169-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020
device-mapper-event-1.02.169-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020
device-mapper-event-libs-1.02.169-2.el8    BUILT: Mon Feb 24 11:21:38 CST 2020


[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  cworigin        writecache_sanity -wi------- 4.00g                                                     /dev/sde1(0)
  test_writecache writecache_sanity -wi------- 2.00g                                                     /dev/sdk1(0)
[root@hayes-02 ~]# lvconvert --yes --test --type writecache --cachevol writecache_sanity/test_writecache writecache_sanity/cworigin
  TEST MODE: Metadata will NOT be updated and volumes will not be (de)activated.
  Logical volume writecache_sanity/cworigin now has write cache.
[root@hayes-02 ~]# echo $?
0
[root@hayes-02 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  cworigin        writecache_sanity -wi------- 4.00g                                                     /dev/sde1(0)
  test_writecache writecache_sanity -wi------- 2.00g                                                     /dev/sdk1(0)

Comment 7 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