Liron Ar has posted comments on this change. Change subject: core: managed removal of memory volumes in negative flows ......................................................................
Patch Set 2: On failure while importing VM or creating snapshot with memory, we need to remove the memory volumes that were copied/created. The remove image operation is asynchronous, i.e it is based on tasks. On negative flows such as the ones mentioned above, we need to remove the memory image in the end-action phase. Since our infrastructure for commands doesn't support scenarios where tasks are created in the end-action phase well, we used to create the tasks for the remove operation without polling them. The problem was that without polling the tasks they remained in VDSM forever. The solution is to invoke the command that removes memory volumes as a stand-alone command, and not as a child of the failed command. It means that the tasks will be created as tasks of RemoveMemoryVolumesCommand and thus its end-action methods will be called and not the ones of the failed command. The approach here should be changed IMO, deleteImage should be treated by the engine as sync operation, after the sync part of the vdsm verb is completed the image no longer exists and we poll the task just to clear it (the task might be a "dummy" task or a task for post zero - but it doesn't matter to the engine). That means that as the sync part ends, the related db operations for the removal might be performed. You should use the RemoveImage command (possibly add there a flag inidcating to not remove anything from the db) and after succesfull execution perform your needed operations. You can poll the tasks by calling startPollingAsyncTasks(..) so they'll be polled and cleared by the engine. You can take an example from CopyImageGroupCommand.revertTasks - just set the parent parameters to the remove image parameters and the parent command to remove image. -- To view, visit http://gerrit.ovirt.org/23222 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4b270ec0e1ab41cae34459dde9f9cf47b1b5bdf Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Arik Hadas <aha...@redhat.com> Gerrit-Reviewer: Liron Ar <lara...@redhat.com> Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: No _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches