Adam Litke has uploaded a new change for review.
Change subject: storage: Search only the current image for children
......................................................................
storage: Search only the current image for children
The getChildren method of FileVolume is currently searching all images
in the storage domain for children. A glob of all metadata files in the
SD is cached and then passed to grep to look for the child volumes. The
problem is that deleteVolumes takes an exclusive lock on the image
namespace only. If deletes are active on other images at the same time
we'll get errors with missing files.
The code mistakenly claims that children can be in any image on the
storage domain. It appears that they are in fact limited to the same
image. Therefore, the simplest resolution is to limit the search for
children to the current image.
Change-Id: I2ef9012cee3a8cb891926510c10ecc47b7cddaa1
Signed-off-by: Adam Litke <alitke(a)redhat.com>
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=1069610
---
M vdsm/storage/fileVolume.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/96/35096/1
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index a8e9835..8737e39 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -361,10 +361,10 @@
def getChildren(self):
""" Return children volume UUIDs.
- Children can be found in any image of the volume SD.
+ Children will always belong to the same image as this volume.
"""
domPath = self.imagePath.split('images')[0]
- metaPattern = os.path.join(domPath, 'images', '*',
'*.meta')
+ metaPattern = os.path.join(domPath, 'images', self.imgUUID,
'*.meta')
metaPaths = oop.getProcessPool(self.sdUUID).glob.glob(metaPattern)
pattern = "%s.*%s" % (volume.PUUID, self.volUUID)
matches = grepCmd(pattern, metaPaths)
--
To view, visit
http://gerrit.ovirt.org/35096
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ef9012cee3a8cb891926510c10ecc47b7cddaa1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Adam Litke <alitke(a)redhat.com>