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/31fbb4cb48c7208e6b37c5c0e27560...
[2] -
https://github.com/oVirt/ovirt-engine/blob/31fbb4cb48c7208e6b37c5c0e27560...