Bug 1271001

Summary: duplicate pvs can be missed by pvscan --cache
Product: Red Hat Enterprise Linux 7 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: LVM Metadata / lvmetad QA Contact: cluster-qe <cluster-qe>
Status: CLOSED NOTABUG Docs Contact:
Severity: unspecified    
Priority: unspecified CC: agk, heinzm, jbrassow, msnitzer, prajnoha, prockai, zkabelac
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-10 20:47:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Teigland 2015-10-12 21:21:46 UTC
Description of problem:

There are still problems with duplicate PVs not being reported with lvmetad.
The example I'm seeing now is:

# lvmetad

# pvscan --cache
  Found duplicate PV 6H5srHtbk2igv1OqBjJbg3r9vDlSZzlj: using /dev/sdd not /dev/sdc
  Using duplicate PV /dev/sdd which is last seen, replacing /dev/sdc
  Found duplicate PV maevmciDh8i0Sr6oQktfx9eCBYgvTwcY: using /dev/sdb not /dev/sde
  Using duplicate PV /dev/sdb without holders, ignoring /dev/sde

# pvs
  Found duplicate PV 6H5srHtbk2igv1OqBjJbg3r9vDlSZzlj: using /dev/sdc not /dev/sdd
  Using duplicate PV /dev/sdc which is last seen, replacing /dev/sdd
  /dev/sdb                lvm2 ---  931.01g 931.01g
  /dev/sdc                lvm2 ---  931.01g 931.01g


The sdd/sdc duplicates are handled like we want, but the sdb/sde duplicates are not recorded as duplicates in lvmetad, and subsequently not reported as duplicates from 'pvs'.  This is because in the sdb/sde case, the first device is preferred over the second within the pvscan --cache command, so the second is never sent to lvmetad.  The "preferred" selection between duplicates within lvmcache_add() is the correct behavior when it's used by a reporting command like pvs, but in the special case of 'pvscan --cache' where lvmetad is being populated, we want a different behavior that will just send all the info to lvmetad.  When the command is just populating lvmetad, it doesn't really make sense to be using the lvmcache layer at all.  If there's no alternative to using lvmcache here, a workaround might be to trick lvmcache_add() to always prefer the new duplicate device when called for pvscan --cache.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 David Teigland 2016-01-19 16:03:08 UTC
It's unlikely that I'll have a the lvmetad duplicate PV handling reworked in time for 7.3.

Comment 3 David Teigland 2016-06-10 20:47:21 UTC
New duplicate handling is done, and lvmetad is disabled while duplicates exist.