Bug 640051 - mirror leg down conversion during log up conversion leads to issues when specifying devs to be removed
Summary: mirror leg down conversion during log up conversion leads to issues when spec...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2
Version: 5.5
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Petr Rockai
QA Contact: Corey Marthaler
URL:
Whiteboard:
Depends On: 602748
Blocks: 640580 5.6-Known_Issues
TreeView+ depends on / blocked
 
Reported: 2010-10-04 16:23 UTC by Corey Marthaler
Modified: 2011-07-21 12:28 UTC (History)
11 users (show)

Fixed In Version: lvm2-2.02.84-1.el5
Doc Type: Bug Fix
Doc Text:
When converting a mirror in such a way that adds devices (either to the image count or log) there must be enough devices available to make the change or the command will fail. This is especially pertinent when specifying physical volumes to be used for the conversion. When up-converting (adding devices to the mirror or its log) and physical volumes are specified, they are treated as the only available source for allocation. Ensure that enough physical volumes are present to satisfy the request. When down-converting (removing devices from the mirror or its log), and physical volumes are specified, they are treated as the preferential devices to be removed. If there are more images to be removed than physical volumes specified, the remaining images are chosen by LVM.
Clone Of: 602748
Environment:
Last Closed: 2011-07-21 10:51:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1071 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2011-07-21 10:50:01 UTC

Comment 1 Heinz Mauelshagen 2010-10-05 10:55:41 UTC
Jon,

putting this into your responsibilty.

Thanks,
Heinz

Comment 2 Zdenek Kabelac 2010-10-19 10:27:28 UTC
Rerouting to Petr, as Jon seems to be busy these days.

Comment 3 Petr Rockai 2010-10-28 23:19:07 UTC
This doesn't seem to be hard to fix, I can try to have a look over the weekend, but I am on PTO afterwards, so if I don't get to send a patch by Sunday, it'll have to wait till after 10th when I'm back (unless someone else can pick up the ball).

Comment 4 Petr Rockai 2010-11-15 14:06:22 UTC
After a discussion, we decided my intended solution (interpreting the PVs depending on their current allocation status with regards to the mirror in question), while doable and reasonable, would be probably somewhat confusing. To that end, we will instead require the operation to be done in two steps, which, for all I can tell, should not compromise any of the use-cases, and gives the user a much better and more transparent control over allocation. It also avoids any possibly confusing behaviours. What needs to be changed then is to disallow operations that both allocate and de-allocate space in lvconvert, printing an informative error message requesting the operation to be performed in two steps.

(We *might* allow an exception for cases where a single step works well enough, and especially if there are existing tools or scripts relying on this behaviour. Specifically, all invocations with no explicit PVs given can continue to work as before.)

I will submit a patch. Corey, if you think the use-case for allowing the above operations (add logs, remove legs at once, specifying PVs to use) in a single step are compelling, please let me know and we can do that as well, at the expense of a somewhat more complicated (harder to understand) UI.

Comment 7 Petr Rockai 2010-11-25 19:49:13 UTC
Checked in upstream.

Comment 12 Ryan Lerch 2011-01-05 00:52:55 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
When converting a mirror in such a way that adds devices - either to the image count or log - there must be enough devices available to make the change or the command will fail.  This is especially pertinent when specifying devices (PVs) to be used for the conversion.  

Specified PVs are treated in the following manor when converting:
Up-converting (adding devices to the mirror or its log):
When PVs are specified, they are treated as the only available source for allocation.  You must specify enough PVs to satisfy the request.

Down-converting (removing devices from the mirror or its log):
When PVs are specified, they are treated as the preferential devices to be removed.  If there are more images to be removed than PVs specified, the remaining images are chosen  by LVM.

Comment 14 Ryan Lerch 2011-01-05 04:45:03 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,8 +1,3 @@
-When converting a mirror in such a way that adds devices - either to the image count or log - there must be enough devices available to make the change or the command will fail.  This is especially pertinent when specifying devices (PVs) to be used for the conversion.  
+When converting a mirror in such a way that adds devices (either to the image count or log) there must be enough devices available to make the change or the command will fail. This is especially pertinent when specifying physical volumes to be used for the conversion.
-
+When up-converting (adding devices to the mirror or its log) and physical volumes are specified, they are treated as the only available source for allocation. Ensure that enough physical volumes are present to satisfy the request.
-Specified PVs are treated in the following manor when converting:
+When down-converting (removing devices from the mirror or its log), and physical volumes are specified, they are treated as the preferential devices to be removed. If there are more images to be removed than physical volumes specified, the remaining images are chosen by LVM.-Up-converting (adding devices to the mirror or its log):
-When PVs are specified, they are treated as the only available source for allocation.  You must specify enough PVs to satisfy the request.
-
-Down-converting (removing devices from the mirror or its log):
-When PVs are specified, they are treated as the preferential devices to be removed.  If there are more images to be removed than PVs specified, the remaining images are chosen  by LVM.

Comment 15 RHEL Program Management 2011-01-11 19:50:28 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 16 RHEL Program Management 2011-01-11 23:04:57 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 17 Milan Broz 2011-03-04 17:53:53 UTC
Fixed in lvm2-2.02.84-1.el5

Comment 20 Corey Marthaler 2011-05-06 16:33:29 UTC
This operation is no longer allowed. Marking verified.

[root@grant-02 ~]# lvconvert -m 3 --mirrorlog core grant/mirror /dev/sdc3 /dev/sdc1
  Cannot both allocate and free extents when specifying physical volumes to use.
  Please specify the operation in two steps.

2.6.18-256.el5

lvm2-2.02.84-3.el5    BUILT: Wed Apr 27 03:42:24 CDT 2011
lvm2-cluster-2.02.84-3.el5    BUILT: Wed Apr 27 03:42:43 CDT 2011
device-mapper-1.02.63-2.el5    BUILT: Fri Mar  4 10:23:17 CST 2011
device-mapper-event-1.02.63-2.el5    BUILT: Fri Mar  4 10:23:17 CST 2011
cmirror-1.1.39-10.el5    BUILT: Wed Sep  8 16:32:05 CDT 2010
kmod-cmirror-0.1.22-3.el5    BUILT: Tue Dec 22 13:39:47 CST 2009

Comment 23 errata-xmlrpc 2011-07-21 10:51:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1071.html

Comment 24 errata-xmlrpc 2011-07-21 12:28:39 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-1071.html


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