Bug 229471 - Tagging causes problems when doing mirror operations
Summary: Tagging causes problems when doing mirror operations
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2
Version: 4.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Milan Broz
QA Contact: Corey Marthaler
URL:
Whiteboard:
: 228839 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-21 13:00 UTC by robert.lawton
Modified: 2013-03-01 04:05 UTC (History)
8 users (show)

Fixed In Version: RHBA-2007-0287
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-16 14:49:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0287 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2007-04-28 19:01:34 UTC

Description robert.lawton 2007-02-21 13:00:04 UTC
Description of problem:
The lvcreate --addtag option does not work when creating a mirrored logical 
volume.

[root@blx12ah01 ~]# grep "volume_list =" /etc/lvm/lvm.conf
    volume_list = [ "intvg00", "intvg01", "@blx12ah01e" ]

[root@blx12ah01 ~]# lvcreate --addtag blx12ah01e -m 1 -L 2g -n yylv00 yyvg00
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.

[root@blx12ah01 ~]# lvs -a -o +tags | grep yylv00
  yylv00_mlog      yyvg00  -wi---   4.00M


Version-Release number of selected component (if applicable):
lvm2-2.02.21-1.el4

How reproducible:
Always

Comment 2 Jonathan Earl Brassow 2007-02-21 15:24:27 UTC
CREATES
=======
We should at least be able to create the mirror if the tag is not present (even
if it cannot be activated); and create and activate if the tag is present.  The
following commands illustrate the point:

[root@kool ~]# grep volume_list /etc/lvm/lvm.conf
    # If volume_list is defined, each LV is only activated if there is a
    volume_list = [ "@kool" ]

# Creates, but does not activate [as expected]
[root@kool ~]# lvcreate -L 500M -n lv vg
  Failed to activate new LV.

[root@kool ~]# lvremove -ff vg
  Logical volume "lv" successfully removed

# Creates and activates [as expected]
[root@kool ~]# lvcreate --addtag kool -L 500M -n lv vg
  Logical volume "lv" created

[root@kool ~]# lvremove -ff vg
  Logical volume "lv" successfully removed

# should create, but not activate [Fails to create]
[root@kool ~]# lvcreate -m1 -L 500M -n lv vg
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.

[root@kool ~]# lvremove -ff vg
  Logical volume "lv_mlog" successfully removed

# should create, and activate [Fails both]
[root@kool ~]# lvcreate --addtag kool -m1 -L 500M -n lv vg
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.


Comment 3 Jonathan Earl Brassow 2007-02-21 15:25:45 UTC
CONVERTS
========
Here we see that creation of transient log mirrors works as expected, but the
conversion to a persistent log mirror fails.

# Creates, but does not activate [as expected]
[root@kool ~]# lvcreate --corelog -m1 -L 500M -n lv vg
  Failed to activate new LV.

[root@kool ~]# lvremove -ff vg
  Logical volume "lv" successfully removed

# Creates and activates [as expected]
[root@kool ~]# lvcreate --addtag kool --corelog -m1 -L 500M -n lv vg
  Logical volume "lv" created

# Should convert to persistent log [fails]
[root@kool ~]# lvconvert -m1 vg/lv
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.

Comment 4 Jonathan Earl Brassow 2007-02-21 15:26:32 UTC
The above failure cases are a result of the fact that we create the sub-device
(lv_mlog) without a tag and then try to activate it in order to initialize it -
outside of its mirror context - before adding it to the mirror.

It should be noted that you can successfully activate/deactivate a mirror with a
persistent log once it has been created (with the proper tag) even though the
sub-devices are not tagged.



Comment 5 Jonathan Earl Brassow 2007-02-21 15:39:02 UTC
*** Bug 228839 has been marked as a duplicate of this bug. ***

Comment 7 Milan Broz 2007-03-26 17:20:23 UTC
Fixed upstream.
Fixed in 2.02.21-5.el4.rpm.

Comment 10 Red Hat Bugzilla 2007-05-08 00:16:16 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 the 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-2007-0287.html

Comment 11 robert.lawton 2007-05-15 20:14:34 UTC
The lvm2-2.02.21-5.el4 RPM has only fixed half the problem.

I can now create a mirrored logical volume if I use the --addtag flag:

[root@clx12ah01 up2date]# grep volume_list /etc/lvm/lvm.conf
    # If volume_list is defined, each LV is only activated if there is a
    volume_list = [ "intvg00", "intvg01", "@clx12ah01" ]

#
# CREATE VOLUME WITH CORRECT TAG WORKS OK
#
[root@clx12ah01 up2date]# lvcreate --addtag clx12ah01 -m 1 -L 1g -n tagtest 
yyvg00
  Logical volume "tagtest" created

#
# CREATE VOLUME WITHOUT SPECIFYING TAG STILL DOES NOT WORK
#
[root@clx12ah01 up2date]# lvcreate -m 1 -L 1g -n notagtest yyvg00
  Aborting. Failed to activate mirror log. Remove new LVs and retry.
  Failed to create mirror log.


Is it reasonable to expect that the untagged volume is created but not 
activated?

If this is not possible due to mirror initialisation, shouldn't it fail more 
gracefully without leaving an orphaned mlog on the system?

Comment 12 Suzanne Logcher 2007-05-16 14:49:11 UTC
An errata was filed for this issue and shipped live.
If further issues are found, please open a new bugzilla.
Moving back to CLOSED/ERRATA.


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