Bug 582251

Summary: lvconvert fails with inactive LVs
Product: [Fedora] Fedora Reporter: Alasdair Kergon <agk>
Component: lvm2Assignee: Jonathan Earl Brassow <jbrassow>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: urgent    
Version: 14CC: agk, bmarzins, bmr, cmarthal, dwysocha, heinzm, jonathan, lvm-team, mbroz, msnitzer, prajnoha, prockai
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 589805 (view as bug list) Environment:
Last Closed: 2011-02-09 22:10:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 589805    
Attachments:
Description Flags
Disallow a second up-convert while one is happening none

Description Alasdair Kergon 2010-04-14 13:50:46 UTC
Retest all the cases of lvconvert (especially those when LVs are initially inactive), fix them to behave sensibly, and add buildbot tests.

Examples:
# lvconvert -m+1  vg3/lvol0 /dev/loop0
  Insufficient suitable allocatable extents for logical volume : 3 more required
  Unable to allocate extents for mirror(s).
  ABORTING: Failed to remove temporary mirror layer lvol0_mimagetmp_2.
  Manual cleanup with vgcfgrestore and dmsetup may be required.

A second lvconvert -m+1 while one is incomplete creates an incorrect tree of devices (i.e. data corruption).

Comment 1 Alasdair Kergon 2010-04-14 15:31:04 UTC
And also should check for the need for exclusive locking (like pvmove does).

Comment 2 Alasdair Kergon 2010-04-15 22:43:55 UTC
See also bug 581611 - an example of data loss occurring in the field.

Comment 4 Jonathan Earl Brassow 2010-04-19 20:58:26 UTC
Created attachment 407680 [details]
Disallow a second up-convert while one is happening

Comment 6 Jonathan Earl Brassow 2010-04-21 14:06:37 UTC
Fix described in comment 4 is now checked in.

Comment 7 Alasdair Kergon 2010-04-26 19:21:07 UTC
Test script:

For lvconvert mirrors, there are 4 states to care about:
  LV doesn't exist (0 legs)
  linear LV (1 leg)
  2-way mirrored LV (2 legs)
  mirrored LV with more than 2 legs (many legs)

(3 legs can represent the "many" class)

Then we need to test all the combinations of transitions between those states.
0->1,  0->2,   0->many,  1->2,  1-> many, 2->many 
and the inverses, many->2, many->1 etc. 
for each transition, it must be tested with inactive LV as well as with active LV
and with all relevant combinations of PVs listed on the cmdline (e.g. when reducing, no PVs, primary, non-primary, sufficient listed, insufficient listed)
and test with 'in sync' and 'not in sync' where relevant

Comment 8 Alasdair Kergon 2010-04-26 19:27:13 UTC
missed many->many off that list

Comment 9 Jonathan Earl Brassow 2010-04-29 19:24:03 UTC
The following was added to the test suite, it should cover all permutations of linear and [234]-way mirrors - including all permutations of log types for those transitions.

+for i in $(seq 0 4); do
+       for j in $(seq 0 4); do
+               for k in core disk mirrored; do
+                       for l in core disk mirrored; do
+                               test_convert $i $k $j $l
+                       done
+               done
+       done
+done

We are still missing the ability in the testsuite to specify specific devices to be used during conversion - including partial specification for down-converts.  Additionally, verification of device placement is also missing.

Comment 10 Corey Marthaler 2010-05-06 22:53:38 UTC
QA has tests now that should cover all these cases. Cloning this bug for rhel5.6 inclusion.

Comment 13 Bug Zapper 2010-07-30 11:20:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping