Bug 2125023

Summary: improve handling of duplicate vgids
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: LVM Team <lvm-team>
lvm2 sub component: Devices, Filtering and Stacking QA Contact: cluster-qe <cluster-qe>
Status: NEW --- Docs Contact:
Severity: high    
Priority: high CC: agk, cmarthal, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, teigland, thornber, zkabelac
Version: 8.7Keywords: Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2040456 Environment:
Last Closed: 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:
Bug Depends On: 2040456    
Bug Blocks:    

Comment 3 Corey Marthaler 2022-09-07 18:46:11 UTC
I can't remember if this was to be fixed in rhel8 as well?

kernel-4.18.0-417.el8    BUILT: Wed Aug 10 15:40:43 CDT 2022
lvm2-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022
lvm2-libs-2.03.14-6.el8    BUILT: Fri Jul 29 05:40:53 CDT 2022




SCENARIO - duplicate_vg_uuids_with_devicesfile_disabled:  Test how LVM reacts to PVs having the same pv and vg uuids while devicesfile is disabled (bug 2040456) 
adding entry to the devices file for /dev/sdb1
creating PV on hayes-01 using device /dev/sdb1
pvcreate --yes -ff   /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.
creating VG on hayes-01 using PV(s) /dev/sdb1
vgcreate    df /dev/sdb1
  Volume group "df" successfully created

Disabling devicesfile on hayes-01
Setting use_devicesfile to disable
  PV /dev/sdb1   VG df              lvm2 [<1.82 TiB / <1.82 TiB free]
  Total: 1 [<1.82 TiB] / in use: 1 [<1.82 TiB] / in no VG: 0 [0   ]

Copying header from /dev/sdb1 to /dev/sdc1 on hayes-01
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.0284696 s, 36.8 MB/s
Re-scanning lvm PVs (pvscan --cache)
  pvscan[441785] PV /dev/sdb1 online.

Disabling device sdb on hayes-01
'echo offline > /sys/block/sdb/device/state'
  VG #PV #LV #SN Attr   VSize  VFree 
  df   1   0   0 wz--n- <1.82t <1.82t
Renaming df to df_2
vgrename --yes df df_2
  Volume group "df" successfully renamed to "df_2"

Generating a new PV uuid for /dev/sdc1
pvchange -u /dev/sdc1

Enabling device sdb on hayes-01
'echo running > /sys/block/sdb/device/state'
WARNING: ignoring metadata seqno 1 on /dev/sdb1 for seqno 3 on /dev/sdc1 for VG df_2.
  WARNING: Inconsistent metadata found for VG df.
  See vgck --updatemetadata to correct inconsistency.
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_update_vg df_2 no vginfo
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_get_outdated_mdas no vginfo
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_get_outdated_mdas no vginfo
pvs should warn about the need to fix the dup VGID

[root@hayes-01 ~]# pvscan
  WARNING: ignoring metadata seqno 1 on /dev/sdb1 for seqno 3 on /dev/sdc1 for VG df_2.
  WARNING: Inconsistent metadata found for VG df.
  See vgck --updatemetadata to correct inconsistency.
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_update_vg df_2 no vginfo
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_get_outdated_mdas no vginfo
  Internal error: vginfo_lookup vgid KGHXvEiGocST9XkZcb747ypiK691UQ1Y has two names df df_2
  Internal error: lvmcache_get_outdated_mdas no vginfo
  PV /dev/sdc1   VG df_2            lvm2 [<1.82 TiB / <1.82 TiB free]
  Total: 1 [<1.82 TiB] / in use: 1 [<1.82 TiB] / in no VG: 0 [0   ]