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 <akrejcir@redhat.com> 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





_______________________________________________
Devel mailing list -- devel@ovirt.org
To unsubscribe send an email to devel-leave@ovirt.org
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/devel@ovirt.org/message/RMP3S7TD4SKUUSOUDVBMT3KVTBFRTJ7Q/




--
Martin Perina
Associate Manager, Software Engineering
Red Hat Czech s.r.o.