Liron Ar has submitted this change and it was merged.
Change subject: core: proceedStorageDomainTreatmentByDomainType - proper compensation
......................................................................
core: proceedStorageDomainTreatmentByDomainType - proper compensation
proceedStorageDomainTreatmentByDomainType() method updates different
properties of the storage domain, to use the compensation mechanisam in
case of failure the storage domain's static data before the updates was
saved in the compensation context.
The snapshotEntity() method used for saving the static in the
compensation context has documentation stating the in case that the
entity was deleted/updated it would be restored to it's state as saved,
which means that if it was deleted, the entity would be re-inserted.
ForceRemoveStorageDomainCommand is an engine command to remove a domain
from the database forcibly at the user risk, this command can run
parallely to the ReconstructMasterDomainCommand (wether it's right or
wrong is another discussion) which executes the
proceedStorageDomainTreatmentByDomainType() method.
This can cause to an issue - if the domain is removed by the removal
command, the compensation used in the reconstruct command might
re-insert domain related records to the db.
In this patch i handle this issue by using the snapshotEntityUpdated()
method which is more correct in that case (as we only update the entity)
and will remove the possibility of mistkenly re-inserting the data.
Further on we should inspect why and if we should allow those commands
to run in parallel.
Change-Id: I9ec99cf5e567fe9820e4028a886372d73d5c1d6f
Bug-Url:
https://bugzilla.redhat.com/show_bug.cgi?id=969026
Signed-off-by: Liron Aravot <laravot(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
Liron Ar: Verified; Looks good to me, approved
--
To view, visit
http://gerrit.ovirt.org/25232
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I9ec99cf5e567fe9820e4028a886372d73d5c1d6f
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Liron Ar <laravot(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: Yair Zaslavsky <yzaslavs(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server