Bug 1064592 - [RFE] LVM RAID: Allow device specification when performing 'lvconvert --repair'
Summary: [RFE] LVM RAID: Allow device specification when performing 'lvconvert --repair'
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: LVM and device-mapper
Classification: Community
Component: lvm2
Version: 2.02.163
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Fedora
: 2016-09
Assignee: Heinz Mauelshagen
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-12 23:00 UTC by Jonathan Earl Brassow
Modified: 2023-06-29 01:35 UTC (History)
8 users (show)

Fixed In Version: v2_02_163
Doc Type: Enhancement
Doc Text:
Feature: Allow rebuild device specification with "lvchange --rebuild PV LV" Reason: Result:
Clone Of:
Environment:
Last Closed: 2020-06-10 12:42:22 UTC
Embargoed:
heinzm: lvm-technical-solution+
rule-engine: lvm-test-coverage?


Attachments (Terms of Use)

Description Jonathan Earl Brassow 2014-02-12 23:00:52 UTC
Currently it is possible to perform "scrubbing" operations on LVM RAID logical volumes.  If there is a discrepancy found (e.g. a bad parity calculation or non-identical blocks in RAID1), the RAID LV can be made coherent again by performing a 'repair' operation.

The trouble is that the repair operation cannot be directed toward any specific device.  Instead, parity is simply recalculated and mirrors are simply recopied from the lowest indexed source.  If the user somehow knows the device that gone bad.  It should be possible to direct LVM to repair only that device.

The proposed solution is to augment the '--syncaction repair' arguments to take a device name as well, something like: '--syncaction repair:<PV>'.

Alternatively, a command that would allow us to reset the bitmap for a particular device would also work - causing the reconstruction of just that particular device in the array, something like: '--rebuild <PV>'.

For now, a workaround exists.  You can rebuild/resync a particular device in the array by replacing it: 'lvconvert --replace <PV-to-remove> vg/lv'.  This requires a spare device, however.

Comment 6 Heinz Mauelshagen 2016-08-04 14:53:11 UTC
"lvchange --rebuild PV VG/LV" would avoid a kernel change we'd need to support this via "lvchange --syncaction repair PV VG/LV", because the former can pass in the respective rebuild flag via the constructor (already supported and used in repair/replace) but the latter would need a raid target message interface enhancement.

Another tradeoff of the latter is that it doesn't restart after a crahs or a mapping refresh but the former does.

In essence "lvchange --rebuild PV [--rebuild PV...] VG/LV" is a repair/replace without allocation just passing in the rebuild flags intio the kernel.

Comment 7 Heinz Mauelshagen 2016-08-04 17:02:53 UTC
Got POC implementation in testing.

Comment 8 Heinz Mauelshagen 2016-08-05 14:02:18 UTC
Tested solution and pushed upstream.


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