Nir Soffer has uploaded a new change for review.
Change subject: fileSD: Keep deleted images name unique ......................................................................
fileSD: Keep deleted images name unique
If an image delete fails, and same image is created again, the second image cannot be deleted, since the first image occupy the deleted image name.
We use now _remove_me_<imagid>_<taskid>. This make it easy to locate the failed operation in vdsm or engine logs.
Change-Id: Ia0582896d7ede028e9096da1a688e3e449ab0258 Signed-off-by: Nir Soffer nsoffer@redhat.com --- M vdsm/storage/fileSD.py 1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/32/48032/1
diff --git a/vdsm/storage/fileSD.py b/vdsm/storage/fileSD.py index dc4a68e..7d8074a 100644 --- a/vdsm/storage/fileSD.py +++ b/vdsm/storage/fileSD.py @@ -34,6 +34,7 @@ import outOfProcess as oop from remoteFileHandler import Timeout from persistentDict import PersistentDict, DictValidator +from threadLocal import vars from vdsm import constants from vdsm.utils import stripNewLines from vdsm import supervdsm @@ -204,7 +205,8 @@ def deleteImage(self, sdUUID, imgUUID, volsImgs): currImgDir = self.getImagePath(imgUUID) dirName, baseName = os.path.split(currImgDir) - toDelDir = os.path.join(dirName, sd.REMOVED_IMAGE_PREFIX + baseName) + newName = "%s%s_%s" % (sd.REMOVED_IMAGE_PREFIX, baseName, vars.task.id) + toDelDir = os.path.join(dirName, newName) self.log.debug("Renaming dir %s to %s", currImgDir, toDelDir) try: self.oop.os.rename(currImgDir, toDelDir)