Noam Slomianko has uploaded a new change for review.

Change subject: engines: improve data integrity in remove quota (#848816)
......................................................................

engines: improve data integrity in remove quota (#848816)

https://bugzilla.redhat.com/848816

Problem:
- with the enable of multiple quota in a single remove the possibility
for concurrency problems increase.
- if after the quota was removed from the cache and before it is removed
from the database it is accessed it may be loaded in to the cache and
stay there until it is removed once more.

Solution:
- switched the order of execution, first remove from DB and the from cache
now the operation cannot end in an inconsistent state

Change-Id: Ic9850db0041b7106c5a938b2089f4641235ea814
Signed-off-by: Noam Slomianko <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/05/7505/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
index 58119fc..cfca006 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
@@ -4,8 +4,8 @@
 import java.util.List;
 
 import org.ovirt.engine.core.bll.quota.QuotaManager;
+import org.ovirt.engine.core.bll.utils.PermissionSubject;
 import org.ovirt.engine.core.common.AuditLogType;
-import org.ovirt.engine.core.common.PermissionSubject;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.QuotaCRUDParameters;
 import org.ovirt.engine.core.common.businessentities.Quota;
@@ -48,8 +48,8 @@
 
     @Override
     protected void executeCommand() {
-        
QuotaManager.getInstance().removeQuotaFromCache(getQuota().getStoragePoolId(), 
getParameters().getQuotaId());
         getQuotaDAO().remove(getParameters().getQuotaId());
+        
QuotaManager.getInstance().removeQuotaFromCache(getQuota().getStoragePoolId(), 
getParameters().getQuotaId());
         getReturnValue().setSucceeded(true);
     }
 


--
To view, visit http://gerrit.ovirt.org/7505
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic9850db0041b7106c5a938b2089f4641235ea814
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Noam Slomianko <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to