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 1805532 - lvm needs to check that the potential writecache origin is also inactive before it attempts to convert
Summary: lvm needs to check that the potential writecache origin is also inactive befo...
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
medium
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-02-20 23:31 UTC by Corey Marthaler
Modified: 2021-09-07 11:57 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.03.08-2.el8
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:


Attachments (Terms of Use)


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

Description Corey Marthaler 2020-02-20 23:31:07 UTC
Description of problem:

# Active pool, Inactive origin
[root@hayes-02 ~]# lvs -a -o +devices
  LV     VG                Attr       LSize Pool Origin Data% Devices     
  origin writecache_sanity -wi------- 4.00g                   /dev/sdf1(0)
  pool   writecache_sanity -wi-a----- 4.00g                   /dev/sdd1(0)

# LVM tells you it must be inactive
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachesettings ' low_watermark=40 high_watermark=74 writeback_jobs=1531 autocommit_blocks=1066 autocommit_time=2179' --cachevol writecache_sanity/pool writecache_sanity/origin
  LV writecache_sanity/pool must be inactive to attach.



[root@hayes-02 ~]# lvchange -an writecache_sanity/pool
[root@hayes-02 ~]# lvchange -ay writecache_sanity/origin



# Active origin, Inactive pool
[root@hayes-02 ~]# lvs -a -o +devices
  LV     VG                Attr       LSize Pool Origin Data% Devices     
  origin writecache_sanity -wi-a----- 4.00g                   /dev/sdf1(0)
  pool   writecache_sanity -wi------- 4.00g                   /dev/sdd1(0)

# LVM doesn't check and fails due to a locking error
[root@hayes-02 ~]# lvconvert --yes --type writecache --cachesettings ' low_watermark=40 high_watermark=74 writeback_jobs=1531 autocommit_blocks=1066 autocommit_time=2179' --cachevol writecache_sanity/pool writecache_sanity/origin
  Missing writecache's origin uuid LVM-vIEYHDC2wAENOozKSQ7zGxkgiKglsx5BFvTOznpsqAzJFyZ7wM3orqcdV89ENvV2-real.
  Failed to lock logical volume writecache_sanity/origin.


Version-Release number of selected component (if applicable):
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


How reproducible:
Everytime

Comment 1 David Teigland 2020-02-21 13:58:52 UTC
The origin should be allowed active while attaching writecache.
fixed in master by:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=4829f27b76742ed663de0a11babb5b9a5985b741
https://sourceware.org/git/?p=lvm2.git;a=commit;h=8153c5f1e61b305661ab92302ebe1077e2d6f483

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

Comment 6 Corey Marthaler 2020-03-19 21:02:34 UTC
With bug 1808012 now fixed by not allowing *either* the pool or origin to be active, then the verification of this issue is basically the same.

Marking verified in the latest rpms.

kernel-4.18.0-187.el8    BUILT: Fri Mar  6 22:09:03 CST 2020
lvm2-2.03.08-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020
lvm2-libs-2.03.08-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020
device-mapper-1.02.169-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020
device-mapper-libs-1.02.169-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020
device-mapper-event-1.02.169-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020
device-mapper-event-libs-1.02.169-3.el8    BUILT: Wed Mar 18 08:37:57 CDT 2020


[root@host-087 ~]# lvcreate -n origin -L 4G writecache_sanity
  Logical volume "origin" created.
[root@host-087 ~]# lvcreate -n pool -L 4G writecache_sanity
  Logical volume "pool" created.
[root@host-087 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  origin          writecache_sanity -wi-a-----   4.00g                                                       /dev/sdb1(0)   
  pool            writecache_sanity -wi-a-----   4.00g                                                       /dev/sdb1(1024)

# Both active (shouldn't work)
[root@host-087 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool writecache_sanity/origin
  LV writecache_sanity/origin must be inactive to attach writecache.
 
[root@host-087 ~]# lvchange -an writecache_sanity/origin
[root@host-087 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  origin          writecache_sanity -wi-------   4.00g                                                       /dev/sdb1(0)   
  pool            writecache_sanity -wi-a-----   4.00g                                                       /dev/sdb1(1024)

# Only Pool active (shouldn't work)
[root@host-087 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool writecache_sanity/origin
  LV writecache_sanity/pool must be inactive to attach.

[root@host-087 ~]# lvchange -an writecache_sanity/pool
[root@host-087 ~]# lvchange -ay writecache_sanity/origin
[root@host-087 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  origin          writecache_sanity -wi-a-----   4.00g                                                       /dev/sdb1(0)   
  pool            writecache_sanity -wi-------   4.00g                                                       /dev/sdb1(1024)

# Only origin active (shouldn't work)
[root@host-087 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool writecache_sanity/origin
  LV writecache_sanity/origin must be inactive to attach writecache.

[root@host-087 ~]# lvchange -an writecache_sanity/origin
[root@host-087 ~]# lvs -a -o +devices
  LV              VG                Attr       LSize   Pool   Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices        
  origin          writecache_sanity -wi-------   4.00g                                                       /dev/sdb1(0)   
  pool            writecache_sanity -wi-------   4.00g                                                       /dev/sdb1(1024)

# Both inactive (sould work)
[root@host-087 ~]# lvconvert --yes --type writecache --cachevol writecache_sanity/pool writecache_sanity/origin
  Logical volume writecache_sanity/origin now has write cache.

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