Bug 995193 - [RHEL 6.4] vgchange -cn vgname --config 'global {locking_type = 0}' does not work when using mirrored LV device.
Summary: [RHEL 6.4] vgchange -cn vgname --config 'global {locking_type = 0}' does not ...
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.4
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Jonathan Earl Brassow
QA Contact: Cluster QE
Depends On:
TreeView+ depends on / blocked
Reported: 2013-08-08 18:03 UTC by Kevin Toyama
Modified: 2018-12-03 19:34 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.100-1.el6
Doc Type: Bug Fix
Doc Text:
Previously, it was impossible to convert a volume group from clustered to non-clustered with a configuration setting of 'locking_type = 0'. This can be problematic if the cluster is unavailable and it is necessary to convert the volume group to non-clustered mode. This issue has been resolved.
Clone Of:
Last Closed: 2013-11-21 23:26:39 UTC

Attachments (Terms of Use)
output from vgchange -cn testvg --config '{global locking_type = 0}' fail using mirrored LV (31.29 KB, text/plain)
2013-08-09 17:27 UTC, Kevin Toyama
no flags Details

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1704 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-11-20 21:52:01 UTC

Comment 4 Kevin Toyama 2013-08-09 17:22:47 UTC
***Update to case description***

Going back through the case, I opened this with the wrong problem description.  It was *NOT* using software RAID (mdadm) devices.  The command is failing when using a mirrored LV device.

Description should be:

"Steps to Reproduce:
1. create mirrored LV device, e.g.:
   # lvcreate -L 200m -m1 -n mirrorlv testvg /dev/vdb1 /dev/vdc1
2. # vgchange -an testvg
3. set clustered attribute on VG,
  # vgchange -cy testvg
4. try to remove clustered attribute on VG by using 
   # vgchange -cn testvg --config 'global {locking_type = 0}'

Actual Results:
WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  Unable to determine exclusivity of mirrorlv
  Mirror logical volumes must be inactive when changing the cluster attribute.

The mirrored LV is inactive and this should be successful.

Expected Results:
Successfully remove the clustered attribute flag"

Comment 5 Kevin Toyama 2013-08-09 17:27:31 UTC
Created attachment 784936 [details]
output from vgchange -cn testvg --config '{global locking_type = 0}' fail using mirrored LV

Output requested on vgchange -vvvv command.

Comment 8 Jonathan Earl Brassow 2013-08-12 19:01:50 UTC
Fix committed upstream:

commit abc89422af75fa9e20d24285d1366e4631cb8748
Author: Jonathan Brassow <jbrassow@redhat.com>
Date:   Mon Aug 12 13:56:47 2013 -0500

    Mirror: Fix inability to remove VG's cluster flag if it contains a mirror
    According to bug 995193, if a volume group
        1) contains a mirror
        2) is clustered
        3) 'locking_type' = 0 is used
    then it is not possible to remove the 'c'luster flag from the VG.  This
    is due to the way _lv_is_active behaves.
    We shouldn't allow the cluster flag to be flipped unless the mirrors in
    the cluster are not active.  This is because different kernel modules
    are used depending on whether a mirror is cluster or not.  When we
    attempt to see if the mirror is active, we first check locally.  If it
    is not, then we attempt to check for remotely active instances if the VG
    is clustered.  Since the no_lock locking type is LCK_CLUSTERED, but does
    not implement 'query_resource', remote_lock_held will always return an
    error in this case.  An error from remove_lock_held is treated as though
    the lock _is_ held (i.e. the LV is active remotely).  This blocks the
    cluster flag from changing.
    The solution is to implement 'query_resource' for the no_lock type.  It
    will report a message and return 1.  This will allow _lv_is_active to
    function properly.  The LV would be considered not active remotely and
    the VG can change its flag.

Comment 12 Nenad Peric 2013-10-08 14:36:27 UTC
[root@virt-012 ~]# lvcreate -m 1 -n mirror -L1G clustered
  Logical volume "mirror" created

waited for sync

[root@virt-012 ~]# vgchange -an clustered
  0 logical volume(s) in volume group "clustered" now active
[root@virt-012 ~]# vgchange -cn clustered --config 'global {locking_type = 0}'
  WARNING: Locking disabled. Be careful! This could corrupt your metadata.
  Volume group "clustered" successfully changed

Marking verified with 


Comment 13 errata-xmlrpc 2013-11-21 23:26:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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