Liron Ar has uploaded a new change for review. Change subject: core: compensate on correct status ......................................................................
core: compensate on correct status On deactivate storage domain command, the storage domain(s) status is being saved in the compensation context so that in case of failure - it will be reverted to it's original value. While executing DeactiveStorageDomainCommand, DeactiveStorageDomainVDS command which is spm command might be called - and in case of failure during it's execution, might call setStoragePoolStatus command which changes the pool domains statuses. This failure will propagate to DeactiveStorageDomainCommand and will cause to the compensation saved data to be applied - which might override the changed statuses and return the domain status to be active again. In this change, the domain status is being saved in the compensation context in unknown status rather then active, so in case of failure the status would be reverted to unknown - if the domain is active, it will be reported as active by the hosts and it's status will be updated to active. Change-Id: I9f8a27cbac711fa87db408a06fe22a7b3e9b2da9 Bug-Url: https://bugzilla.redhat.com/920694 Signed-off-by: Liron Aravot <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/67/14767/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java index 9213edf..689abaa 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DeactivateStorageDomainCommand.java @@ -166,6 +166,7 @@ getStoragePoolIsoMapDAO().get (new StoragePoolIsoMapId(getParameters().getStorageDomainId(), getParameters().getStoragePoolId())); + map.setstatus(StorageDomainStatus.Unknown); changeStorageDomainStatusInTransaction(map, StorageDomainStatus.Locked); ProceedStorageDomainTreatmentByDomainType(false); @@ -279,6 +280,7 @@ newMaster.setStorageDomainType(StorageDomainType.Master); _newMasterStorageDomainId = newMaster.getId(); if (!duringReconstruct) { + newMasterMap.setstatus(StorageDomainStatus.Unknown); getCompensationContext().snapshotEntityStatus(newMasterMap, newMasterMap.getstatus()); newMaster.setStatus(StorageDomainStatus.Locked); getStoragePoolIsoMapDAO().updateStatus(newMasterMap.getId(), newMasterMap.getstatus()); -- To view, visit http://gerrit.ovirt.org/14767 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f8a27cbac711fa87db408a06fe22a7b3e9b2da9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Liron Ar <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
