Bug 229471 - Tagging causes problems when doing mirror operations
Tagging causes problems when doing mirror operations
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: lvm2 (Show other bugs)
4.0
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Milan Broz
Corey Marthaler
: Reopened, TestBlocker
: 228839 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-21 08:00 EST by robert.lawton
Modified: 2013-02-28 23:05 EST (History)
8 users (show)

See Also:
Fixed In Version: RHBA-2007-0287
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-16 10:49:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description robert.lawton 2007-02-21 08:00:04 EST
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 10:24:27 EST
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 10:25:45 EST
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 10:26:32 EST
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 10:39:02 EST
*** Bug 228839 has been marked as a duplicate of this bug. ***
Comment 7 Milan Broz 2007-03-26 13:20:23 EDT
Fixed upstream.
Fixed in 2.02.21-5.el4.rpm.
Comment 10 Red Hat Bugzilla 2007-05-07 20:16:16 EDT
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 16:14:34 EDT
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 Yeghiayan 2007-05-16 10:49:11 EDT
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.