Sergey Gotliv has posted comments on this change.

Change subject: engine: Engine has to delete image from DB after VDSM removed it
......................................................................


Patch Set 1:

(1 comment)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveImageCommand.java
Line 94:                 }
Line 95:                 // in case of any error other than 
ImageDoesNotExistInDomainError, Engine has to check
Line 96:                 // if the image still exists on the storage, because 
VDSM renames the image before deleting it,
Line 97:                 // so technically the image doesn't exist after 
renaming but the actual delete can still fail.
Line 98:                 else if (isImageRemovedFromStorage()) {
I don't like to write novels in the gerrit, but I see I have no other choice.

1. performImageDbOperations removes image from DB, it already did it after 
ImageIsNotExist failure it can do that with the same success rate for any other 
VDSM failure. 

Let's face with the fact, VDSM created a problem, it throws ImageDeleteError in 
2 completely different cases:

a. Rename is failed => means image maybe still exists on the storage
b. Delete after rename failed => image doesn't exist 100%, but renamed garbage 
is there. Why this is an error and not a warning?

But the interesting thing is:
The image is marked as ILLEGAL even before Engine calls to VDSM, so each 
failure in VDSM other than ImageIsNotExist will leave this image in DB with 
ILLEGAL state. 
So from Engine perspective once this command is called the image is useless - 
it will be ILLEGAL or deleted, right? Now, according to our previous 
discussion, we want to ignore ILLEGAL images while importing the same Template 
second time, so if we ignore it anyway I prefer to make deleting logic straight 
forward and delete what is anyway not there.

2. GetImageList can fail - network or something, but this is a corner case and 
anyway at this point I did the best to delete what is deleted.

3. I have another patch for the first part. I just didn't publish it yet, 
because its more  risky. I can bypass CDA validation error if the image is 
ILLEGAL, but my problem is not the CDA, but the ability of Engine to complete 
the flow correctly after that bypass. 

In this case the right question is why Engine will succeeded to import Template 
for the second time if according to CDA it should fail(now CDA recommend the 
user to perform clone)
Line 99:                     log.infoFormat("The image group with id {0} was 
deleted from storage");
Line 100:                 } else {
Line 101:                     throw e;
Line 102:                 }


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

Gerrit-MessageType: comment
Gerrit-Change-Id: If6e6922b153145de6d4515812c1cfede687544bc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to