Allon Mureinik has posted comments on this change.

Change subject: core: ReplicateDisk - prevent rollback on engine restart
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(5 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/lsm/VmReplicateDiskFinishTaskHandler.java
Line 49:         try {
Line 50:             VDSReturnValue returnValue = 
Backend.getInstance().getResourceManager().
Line 51:                     
RunVdsCommand(VDSCommandType.VmReplicateDiskFinish, migrationCompleteParams);
Line 52: 
Line 53:             if (returnValue.getSucceeded()) {
Suppose it is unsuccessful:
Line 54:                 // If the split succeeded, update the database
Line 55:                 moveDiskInDB();
Line 56:                 updateImagesInfo();
Line 57:                 
ImagesHandler.updateImageStatus(getEnclosingCommand().getParameters().getDestinationImageId(),


Line 57:                 
ImagesHandler.updateImageStatus(getEnclosingCommand().getParameters().getDestinationImageId(),
Line 58:                         ImageStatus.OK);
Line 59:             }
Line 60:             else {
Line 61:                 handleBeforeTaskFailure();
You handle the failure once
Line 62:                 throw new 
VdcBLLException(returnValue.getVdsError().getCode(), 
returnValue.getVdsError().getMessage());
Line 63:             }
Line 64:         } catch (Exception ex) {
Line 65:             handleBeforeTaskFailure();


Line 58:                         ImageStatus.OK);
Line 59:             }
Line 60:             else {
Line 61:                 handleBeforeTaskFailure();
Line 62:                 throw new 
VdcBLLException(returnValue.getVdsError().getCode(), 
returnValue.getVdsError().getMessage());
throw an exception
Line 63:             }
Line 64:         } catch (Exception ex) {
Line 65:             handleBeforeTaskFailure();
Line 66:             throw ex;


Line 60:             else {
Line 61:                 handleBeforeTaskFailure();
Line 62:                 throw new 
VdcBLLException(returnValue.getVdsError().getCode(), 
returnValue.getVdsError().getMessage());
Line 63:             }
Line 64:         } catch (Exception ex) {
catch it here
Line 65:             handleBeforeTaskFailure();
Line 66:             throw ex;
Line 67:         }
Line 68:     }


Line 61:                 handleBeforeTaskFailure();
Line 62:                 throw new 
VdcBLLException(returnValue.getVdsError().getCode(), 
returnValue.getVdsError().getMessage());
Line 63:             }
Line 64:         } catch (Exception ex) {
Line 65:             handleBeforeTaskFailure();
and handle failure again
Line 66:             throw ex;
Line 67:         }
Line 68:     }
Line 69: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ibd088940d6e3f7be79fb0381076499ea1c1d73c7
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Daniel Erez <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to