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 1915492 - allow forced detach of damaged cachevol
Summary: allow forced detach of damaged cachevol
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
unspecified
Target Milestone: rc
: 8.0
Assignee: David Teigland
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-12 18:02 UTC by David Teigland
Modified: 2021-11-10 08:51 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.03.12-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:45:25 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2021:4431 0 None None None 2021-11-09 19:45:43 UTC

Description David Teigland 2021-01-12 18:02:08 UTC
Description of problem:

We're missing a way to forcibly detach a cachevol if it becomes damaged or invalid, and is unrepairable.  We do allow forced detaching with --force if the cachevol is missing devices.  We need to allow the forced detach for other kinds of unrepairable damage, and not limit it to the case of missing devices.

(A user could work around this by filtering the damaged cache devices, or wiping their headers to make them look missing, and then lvm would allow --force to detach the cache.)

In cases where cache devices are lost or unrepairable, the user may want to try to recover data from the origin LV.  That data would often be incomplete and in some invalid state itself, because data from the cache was never flushed.  In some limited cases the data in the origin may be fine or easily repairable.

Forcibly detaching the cache means not trying to activate the LV or flush the cache, both of which fail by definition with a missing or corrupted cache.  This forcible detach would generally be done only after repair fails or cache devices are missing altogether.

There is no new command, the existing lvconvert --splitcache --force is used, but is now permitted even if the cachevol devices are present.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 6 Corey Marthaler 2021-06-10 21:10:17 UTC
Fix verified in the latest rpms.

kernel-4.18.0-310.el8    BUILT: Thu May 27 14:24:00 CDT 2021
lvm2-2.03.12-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021
lvm2-libs-2.03.12-2.el8    BUILT: Tue Jun  1 06:55:37 CDT 2021


SCENARIO - [verify_writecache_error_attr_after_offline_pool_corruption]
Create a snapshot of writecache origin and then verify new (E)rror attribute after OFFLINE pool corruption

*** Writecache info for this scenario ***
*  origin (slow):  /dev/sdd1
*  pool (fast):    /dev/sdi1
************************************

Adding "slow" and "fast" tags to corresponding pvs
Create origin (slow) volume
lvcreate --yes --wipesignatures y  -L 4G -n cworigin writecache_sanity @slow

Create writecache cvol (fast) volumes
lvcreate --yes  -L 4G -n POOL writecache_sanity @fast

Deactivate *ONLY* fast pool before conversion to write cache (SEE bug 1185347)
Create writecached volume by combining the cache pool (fast) and origin (slow) volumes
lvconvert --yes --type writecache --cachesettings 'low_watermark=21 high_watermark=92 writeback_jobs=1531 autocommit_blocks=1118 autocommit_time=2014' --cachevol writecache_sanity/POOL writecache_sanity/cworigin
Placing an XFS filesystem on origin volume
Mounting origin volume

Writing files to /mnt/cworigin

Checking files on /mnt/cworigin

Creating thin snapshot of origin volume
lvcreate --yes  -s /dev/writecache_sanity/cworigin -c 128 -n snap -L 500M
Mounting thin snapshot volume and origin
mkdir -p /mnt/snap
mount -o nouuid /dev/writecache_sanity/snap /mnt/snap
Checking files on /mnt/snap

dmsetup table | grep writecache_sanity-POOL_cvol
Swapping the current pool device table (writecache_sanity-POOL_cvol: 0 8388608 linear 8:129 2048) for an error target
dmsetup suspend writecache_sanity-cworigin
dmsetup suspend writecache_sanity-POOL_cvol
Loading in new pool device table (0 8388608 error 8:129 2048)
dmsetup load writecache_sanity-POOL_cvol --table " 0 8388608 error 8:129 2048"
dmsetup resume writecache_sanity-POOL_cvol
dmsetup resume writecache_sanity-cworigin
Attempt --repair on live pool (should fail)
lvconvert --yes --repair writecache_sanity/POOL_cvol
  Command on LV writecache_sanity/POOL_cvol does not accept LV type linear.
  Command not permitted on LV writecache_sanity/POOL_cvol.
Attempt to split off write cache pool (should spin and cause the (E)rror state mentioned in bug 1805893)
lvconvert --force --splitcache writecache_sanity/cworigin
  Detaching writecache setting cleaner.
Sending splitcache pid 5050 a SIGINT
  Detaching writecache cleaning 736636 blocks
  This command can be cancelled and rerun to complete writecache detach.
lvs attribute:owi-a-C-E-
Now deactivate and the force spilt should work (RFE 1915492)
lvchange -an writecache_sanity
lvconvert --yes --force --splitcache writecache_sanity/cworigin
  WARNING: Data may be lost by detaching writecache without flushing.

lvremove -f writecache_sanity

Comment 9 errata-xmlrpc 2021-11-09 19:45: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-2021:4431


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