Yaniv Bronhaim has posted comments on this change.

Change subject: core: Remove image when VDSM returns not exist.
......................................................................


Patch Set 6: (1 inline comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java
Line 88:                                     
getDiskImage().getStoragePoolId().getValue());
Line 89:                 } else {
Line 90:                     throw e;
Line 91:                 }
Line 92:             }
This specific case talks about what engine does when getting an exception from 
vdsm that means that the task wasn't created by vdsm but the operation is done 
in the past. Like removeImage gets exception that the image does not exist. 

>From engine point of view we have to sign the operation as success, because no 
>matter what we do, the image doesn't exist and this case is reasonable and 
>right. 

Each async operation translates to task by the engine, so this task doesn't 
need to be monitored, but should saved in memory\DB and close the operation 
with success flag.

This is not an hack, it's a possible scenario that we need to handle, starting 
a task without monitoring it, like sync task for task that should be async. In 
other words, we create asyncTask with a status of success because the specific 
task should be async but wasn't due to the exception that means that the task 
was done before in vdsm .. we keep the current flow, creating a task, sign it 
directly to preparingToEndCommand, with a specific status, and let the flow end 
the operation, just with skipping the polling part. it absolutely reasonable . 
Vdsm just tries to perform a task, each task that engine starts should be a 
task to complete the operation even if vdsm doesn't start a task of its own.

So, here we create a task, try to poll it, and when distinguish that it does 
not exist in vdsm, we continue and sign it as failed. I think we should add a 
method to allow creating task with a status that bypass the polling part and 
sign the status based on the exception.. the task should be kept in the DB to 
persist the handling after restart , and the newCreateTaskWithStatus should 
persist the operation like the status was polled from vdsm.
Line 93:             getReturnValue().getInternalTaskIdList().add(
Line 94:                     createTask(creationInfo,
Line 95:                             getParameters().getParentCommand(),
Line 96:                             VdcObjectType.Storage,


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I36915c44e65e20e3ce222683650a562603e4bb05
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Liron Ar <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: liron aravot <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to