Bug 582251 - lvconvert fails with inactive LVs
lvconvert fails with inactive LVs
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: lvm2 (Show other bugs)
14
All Linux
urgent Severity high
: ---
: ---
Assigned To: Jonathan Earl Brassow
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 589805
  Show dependency treegraph
 
Reported: 2010-04-14 09:50 EDT by Alasdair Kergon
Modified: 2011-02-09 17:10 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 589805 (view as bug list)
Environment:
Last Closed: 2011-02-09 17:10:40 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
Disallow a second up-convert while one is happening (701 bytes, patch)
2010-04-19 16:58 EDT, Jonathan Earl Brassow
no flags Details | Diff

  None (edit)
Description Alasdair Kergon 2010-04-14 09:50:46 EDT
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 11:31:04 EDT
And also should check for the need for exclusive locking (like pvmove does).
Comment 2 Alasdair Kergon 2010-04-15 18:43:55 EDT
See also bug 581611 - an example of data loss occurring in the field.
Comment 4 Jonathan Earl Brassow 2010-04-19 16:58:26 EDT
Created attachment 407680 [details]
Disallow a second up-convert while one is happening
Comment 6 Jonathan Earl Brassow 2010-04-21 10:06:37 EDT
Fix described in comment 4 is now checked in.
Comment 7 Alasdair Kergon 2010-04-26 15:21:07 EDT
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 15:27:13 EDT
missed many->many off that list
Comment 9 Jonathan Earl Brassow 2010-04-29 15:24:03 EDT
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 18:53:38 EDT
QA has tests now that should cover all these cases. Cloning this bug for rhel5.6 inclusion.
Comment 13 Bug Zapper 2010-07-30 07:20:34 EDT
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

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