Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 660471

Summary: Support multiple --addtag and --deltag arguments within a single pvchange cluster command
Product: Red Hat Enterprise Linux 6 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact: Corey Marthaler <cmarthal>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: agk, dwysocha, heinzm, jbrassow, joe.thornber, mbroz, prajnoha, prockai, pvrabec, snagar
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lvm2-2.02.82-1.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 14:27:15 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2010-12-06 21:20:40 UTC
Description of problem:
This basically bug 652662 for PVs in a cluster.

Currently if you attempt >1 --add|--del tags, you'll get a cluster error.

[root@grant-01 ~]#  pvchange --deltag 1 --deltag 2  /dev/sdb2
  Physical volume "/dev/sdb2" changed
  cluster request failed: Invalid argument
  1 physical volume changed / 0 physical volumes not changed


Version-Release number of selected component (if applicable):
2.6.32-71.el6.x86_64

lvm2-2.02.72-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
lvm2-libs-2.02.72-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
lvm2-cluster-2.02.72-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
udev-147-2.29.el6    BUILT: Tue Aug 31 16:44:10 CDT 2010
device-mapper-1.02.53-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
device-mapper-libs-1.02.53-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
device-mapper-event-1.02.53-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
device-mapper-event-libs-1.02.53-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010
cmirror-2.02.72-8.el6_0.3    BUILT: Fri Nov 12 10:01:34 CST 2010


How reproducible:
Everytime

Comment 2 Milan Broz 2010-12-23 13:01:00 UTC
I am afraid this fails even with 1 argument now, seems like some regression.

Comment 3 Milan Broz 2010-12-23 13:32:44 UTC
Anything stranhge here? :-)

# pvchange --addtag 1 /dev/sdc -vvvv 2>&1 |grep Locking
#locking/cluster_locking.c:472       Locking VG V_vg_test PW (VG) (0x4)
#locking/cluster_locking.c:472       Locking VG P_vg_test PW (VG|CACHE) (0x104)
#locking/cluster_locking.c:472       Locking VG P_vg_test PW (VG|HOLD|CACHE) (0x124)
#locking/cluster_locking.c:472       Locking VG V_vg_test UN (VG) (0x6)
#locking/cluster_locking.c:472       Locking VG P_#global UN (VG) (0x6)

CLVMD[7f28f700]: Dec 23 14:30:47 doing PRE command LOCK_VG 'P_#global' at 6 (client=0xdb6810)
CLVMD[7f28f700]: Dec 23 14:30:47 Writing status 22 down pipe 12
CLVMD[825727a0]: Dec 23 14:30:47 read on PIPE 11: 4 bytes: status: 22
CLVMD[825727a0]: Dec 23 14:30:47 background routine status was 22, sock_client=0xdb6810

Comment 4 Milan Broz 2010-12-23 14:29:26 UTC
This was bug, there is no reason why this shoul not work in cluster.

Fixed by this change upstream (2.02.80):

@@ -288,9 +288,9 @@ int pvchange(struct cmd_context *cmd, int argc, char **argv)
                                unlock_and_free_vg(cmd, vg, sll->str);
                        }
                }
+               unlock_vg(cmd, VG_GLOBAL);
        }
 
-       unlock_vg(cmd, VG_GLOBAL);

Comment 5 Milan Broz 2010-12-23 14:30:49 UTC
(Please not that RFE for supporting addtags + deltags in one command is bug #660467 )

Comment 10 Corey Marthaler 2011-03-10 17:37:42 UTC
Fix verified in the latest rpms.

2.6.32-94.el6.x86_64

lvm2-2.02.83-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
lvm2-libs-2.02.83-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
lvm2-cluster-2.02.83-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
udev-147-2.31.el6    BUILT: Wed Jan 26 05:39:15 CST 2011
device-mapper-1.02.62-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
device-mapper-libs-1.02.62-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
device-mapper-event-1.02.62-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
device-mapper-event-libs-1.02.62-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011
cmirror-2.02.83-2.el6    BUILT: Tue Feb  8 10:10:57 CST 2011


[root@taft-01 ~]# service clvmd status
clvmd (pid  3971) is running...
Clustered Volume Groups: taft
Active clustered Logical Volumes: (none)

[root@taft-01 ~]# pvchange --addtag 1 --addtag 2 --addtag 3 /dev/sdb1 /dev/sdc1
  Physical volume "/dev/sdb1" changed
  Physical volume "/dev/sdc1" changed
  2 physical volumes changed / 0 physical volumes not changed

[root@taft-01 ~]# pvs -a -o +pv_tags
  /dev/sdb1              taft      lvm2 a-   135.66g 135.66g 1,2,3
  /dev/sdc1              taft      lvm2 a-   135.66g 135.66g 1,2,3

Comment 11 errata-xmlrpc 2011-05-19 14:27:15 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-0772.html