Sergey Gotliv has posted comments on this change.

Change subject: Fix rollback after failure to create snapshot
......................................................................


Patch Set 2:

(4 comments)

....................................................
File vdsm/storage/volume.py
Line 252:     def clone(self, dst_image_dir, dst_volUUID, volFormat, 
preallocate):
Line 253:         """
Line 254:         Clone self volume to the specified dst_image_dir/dst_volUUID
Line 255:         """
Line 256:         dst_path = None
I agree, probably only createVolume needs prepare, but most of these things can 
throw Exceptions and I don't want to create another try-except block here to 
transform possible exceptions in order to preserve current behavior
Line 257:         try:
Line 258:             self.prepare(rw=False)
Line 259:             dst_path = os.path.join(dst_image_dir, dst_volUUID)
Line 260:             self.log.debug("Volume.clone: %s to %s" %


Line 254:         Clone self volume to the specified dst_image_dir/dst_volUUID
Line 255:         """
Line 256:         dst_path = None
Line 257:         try:
Line 258:             self.prepare(rw=False)
Done
Line 259:             dst_path = os.path.join(dst_image_dir, dst_volUUID)
Line 260:             self.log.debug("Volume.clone: %s to %s" %
Line 261:                            (self.volumePath, dst_path))
Line 262:             size = int(self.getMetaParam(SIZE))


Line 266:             parent = 
os.path.join(os.path.basename(os.path.dirname(parent)),
Line 267:                                   os.path.basename(parent))
Line 268:             createVolume(parent, parent_format, dst_path,
Line 269:                          size, volFormat, preallocate)
Line 270:             self.teardown(self.sdUUID, self.volUUID)
Done
Line 271:         except Exception as e:
Line 272:             self.teardown(self.sdUUID, self.volUUID)
Line 273:             self.log.error("Volume.clone: can't clone: %s to %s" %
Line 274:                            (self.volumePath, dst_path))


Line 313:     def refreshVolume(self):
Line 314:         """
Line 315:         Refresh volume
Line 316:         """
Line 317:         pass
It seems that Recovery is working FILO, which means that in case of failure 
"parentVolumeRollback" is first to be executed => which means that child volume 
is still there => which means call to recheckIfLeaf may return false therefore 
rollback needs to call setLeaf() either.
Line 318: 
Line 319:     @classmethod
Line 320:     def startCreateVolumeRollback(cls, taskObj, sdUUID, imgUUID, 
volUUID):
Line 321:         cls.log.info("startCreateVolumeRollback: sdUUID=%s imgUUID=%s 
"


-- 
To view, visit http://gerrit.ovirt.org/18205
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I11948aacad21008ffbb4cb23013bf363e60bdb9b
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: Ayal Baron <aba...@redhat.com>
Gerrit-Reviewer: Eduardo <ewars...@redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com>
Gerrit-Reviewer: Sergey Gotliv <sgot...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to