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 713145

Summary: [vdsm][storage]vdsm is writing duplicated pvs (different mapoffset) in the metadata
Product: Red Hat Enterprise Linux 6 Reporter: Moran Goldboim <mgoldboi>
Component: vdsmAssignee: Eduardo Warszawski <ewarszaw>
Status: CLOSED ERRATA QA Contact: Moran Goldboim <mgoldboi>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2CC: abaron, bazulay, danken, ewarszaw, iheim, smizrahi, ykaul
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: vdsm-4.9-79 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 07:21:05 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:
Attachments:
Description Flags
vdsm log none

Description Moran Goldboim 2011-06-14 13:31:35 UTC
Created attachment 504674 [details]
vdsm log

Description of problem:
trying to extend an existing vg using rhevm - vdsm errored with-Storage domain is made from too many PVs.
though storage domain only 4 pvs and limitation is 10.
looking on metadata for this domain i have seen that same pvs exist as different pvs - the one differential is the mapoffset:
PV0=pv:36006016066102900be8c283b0344e011,uuid:PeSvc3-gl85-qdo7-Gjeu-MkAV-58mG-zD7ZH2,pestart:0,pecount:1198,mapoffset:0
PV1=pv:36006016066102900be8c283b0344e011,uuid:PeSvc3-gl85-qdo7-Gjeu-MkAV-58mG-zD7ZH2,pestart:0,pecount:1198,mapoffset:1198
PV2=pv:36006016066102900361493a64a79e011,uuid:8Yqmeu-UqBz-VcoQ-6T71-xgeG-eBcH-yk3EyC,pestart:0,pecount:2399,mapoffset:2396
PV3=pv:36006016066102900351493a64a79e011,uuid:1q1i3t-8P96-0MRF-qeR2-qgub-v0yM-nz5vt6,pestart:0,pecount:2399,mapoffset:4795
PV4=pv:36006016066102900341493a64a79e011,uuid:x6plSX-cntB-ca3o-EDJM-AWEg-kWqs-pXxg5s,pestart:0,pecount:2399,mapoffset:7194
PV5=pv:36006016066102900be8c283b0344e011,uuid:PeSvc3-gl85-qdo7-Gjeu-MkAV-58mG-zD7ZH2,pestart:0,pecount:1198,mapoffset:9593
PV6=pv:36006016066102900361493a64a79e011,uuid:8Yqmeu-UqBz-VcoQ-6T71-xgeG-eBcH-yk3EyC,pestart:0,pecount:2399,mapoffset:10791
PV7=pv:36006016066102900351493a64a79e011,uuid:1q1i3t-8P96-0MRF-qeR2-qgub-v0yM-nz5vt6,pestart:0,pecount:2399,mapoffset:13190
PV8=pv:36006016066102900341493a64a79e011,uuid:x6plSX-cntB-ca3o-EDJM-AWEg-kWqs-pXxg5s,pestart:0,pecount:2399,mapoffset:15589
PV9=pv:360060160661029009a697f653b86e011,uuid:dJHdML-fpkS-22Uj-Sehf-JEJ5-1DA9-kZnlsf,pestart:0,pecount:5599,mapoffset:17988

Version-Release number of selected component (if applicable):
vdsm-4.9-73.el6.x86_64

How reproducible:
happened once

Steps to Reproduce:
1.no clear repo yet - this vg was extended once before and with ALUA configuration.
2.
3.
  
Actual results:


Expected results:


Additional info:
Thread-40650::ERROR::2011-06-14 16:16:46,367::dispatcher::103::Storage.Dispatcher.Protect::(run) {'status': {'message': 'Storage domain is made from too many PVs: ()', 'code':
 388}, 'args': [()]}

Comment 2 Dan Kenigsberg 2011-06-19 15:10:45 UTC
Reducing severity, as this behavior is not that horrible, and affects only old-style metadata.

Comment 3 Saggi Mizrahi 2011-06-20 16:07:15 UTC
[smizrahi@smizrahi storage (next)]$ git diff
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index 956f7f9..6f68d49 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -407,10 +407,15 @@ class BlockStorageDomain(sd.StorageDomain):
         mapping = {}
         devNum = len(oldMapping)
         for dev in pvlist:
+            knownDev = False
             for pvID, oldInfo in oldMapping.iteritems():
                 if os.path.basename(dev) == oldInfo["guid"]:
                     mapping[pvID] = oldInfo
-                    continue
+                    knownDev = True
+                    break
+
+            if knownDev:
+                continue
 
             pv = lvm.getPV(dev)
             pvInfo = {}
@@ -426,9 +431,9 @@ class BlockStorageDomain(sd.StorageDomain):
             else:
                 prevDevNum = devNum - 1
                 try:
-                    prevInfo = mapping["PV%d" % (prevDevNum)]
+                    prevInfo = mapping["PV%d" % (prevDevNum,)]
                 except KeyError:
-                    prevInfo = oldMapping["PV%d" % (prevDevNum)]
+                    prevInfo = oldMapping["PV%d" % (prevDevNum,)]
 
                 mapOffset = int(prevInfo["mapoffset"]) + int(prevInfo["pecount"])

Comment 4 Dan Kenigsberg 2011-06-21 08:19:59 UTC
I understand why the patch of comment 3 removes duplicate pv mapping, but I do not get how we had such duplication in the metadata anyway.

http://gerrit.usersys.redhat.com/609

Comment 5 Dan Kenigsberg 2011-06-23 08:09:52 UTC
Apparently, this bug should reproduce after extending a VG with additional PVs.

Comment 8 Moran Goldboim 2011-07-06 07:56:57 UTC
verified on vdsm-4.9-79.el6.x86_64

Comment 9 errata-xmlrpc 2011-12-06 07:21:05 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.

http://rhn.redhat.com/errata/RHEA-2011-1782.html