Skip to content

Commit

Permalink
blockVolume: check parent tag and meta match
Browse files Browse the repository at this point in the history
blockVolume getParent method uses the volume tag
PU_<id> to obtain the parent. However, this tag
could be outdated. For example, when the host
syncs a volume chain after removing a volume,
it only updates the metadata. Afterwards,
the SPM will update the volume tag once the
volume is deleted.

To ensure we do not return outdated parent UUID,
we need to ensure that the parent UUID obtained
from the parent tag, and the UUID in the volume
metadata match, and log a warning and update
the volume otherwise.

Bug-Url: https://bugzilla.redhat.com/2103582
Signed-off-by: Albert Esteve <aesteve@redhat.com>
  • Loading branch information
aesteve-rh committed Jul 20, 2022
1 parent 62544a7 commit 0d02269
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/vdsm/storage/blockVolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ def getParent(self):
"""
Return parent volume UUID
"""
parent_tag = self.getParentTag()
parent_meta = self.getParentMeta()
if parent_tag != parent_meta:
self.log.warning(
"volUUID=%s parent in tag (%s) and metadata (%s) differ",
self.volUUID, parent_tag, parent_meta)
self.refreshVolume()
return self.getParentTag()

def getChildren(self):
Expand Down

0 comments on commit 0d02269

Please sign in to comment.