As Ravi is on PTO till end of August, Moti could you please take a look and
reply?

On Thu, Aug 16, 2018 at 6:21 PM, Andrej Krejcir <[email protected]> wrote:

> Hi,
>
> I'm changing UpdateClusterCommand to be non-transactive,
> and it would use CompensationContext for reverting DB operations.
>
> Reading through CommandBase code, I noticed the following flow seems to be
> broken:
>
> 1. A command without transaction is executed.
> 2. It executes a child command, with the compensation context of the
> current command. So that the result of the child command can be reverted if
> the parent fails.
> 3. Once the child command successfully finishes, it removes all entity
> snapshots from the DB (it calls CommandContext::
> cleanupCompensationDataAfterSuccessfulCommand), even if the snapshots
> were made by the parent command. See code at [1] and [2].
> 4. The parent command then fails for some other reason, but its
> compensation context is empty, so the DB operations are not reverted
> correctly.
>
>
> Am I missing something or is this flow broken?
>
>
> Thanks,
> Andrej
>
>
> [1] - https://github.com/oVirt/ovirt-engine/blob/
> 31fbb4cb48c7208e6b37c5c0e27560599e15cef9/backend/manager/
> modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java#L1171
> [2] - https://github.com/oVirt/ovirt-engine/blob/
> 31fbb4cb48c7208e6b37c5c0e27560599e15cef9/backend/manager/
> modules/bll/src/main/java/org/ovirt/engine/core/bll/context/
> DefaultCompensationContext.java#L206
>
>
>
> _______________________________________________
> Devel mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct: https://www.ovirt.org/community/about/community-
> guidelines/
> List Archives: https://lists.ovirt.org/archives/list/[email protected]/
> message/RMP3S7TD4SKUUSOUDVBMT3KVTBFRTJ7Q/
>
>


-- 
Martin Perina
Associate Manager, Software Engineering
Red Hat Czech s.r.o.
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/HEQ33CHBRYK7PIRGI4GUYCRRTY3BB3WI/

Reply via email to