Shireesh Anjal has uploaded a new change for review.

Change subject: gluster: Added locking mechanism in GlusterManager
......................................................................

gluster: Added locking mechanism in GlusterManager

GlusterManager can potentially interfere with BLL commands that
execute a gluster command and then update DB with appropriate
changes. Hence it is required that all such gluster BLL commands
acquire a lock before performing their logic, and release it in
the end.

To enable this, the method GlusterCommandBase#executeCommand has
been marked as final, and a new abstract method has been introduced
in the form of GlusterCommandBase#executeGlusterCommand

All existing gluster BLL commands have been refactored by
- renaming executeCommand to executeGlusterCommand
- adding the annotation @RequireGlusterManagerLock wherever required

>From now on, if any new gluster BLL command being written follows
the pattern of

a) Execute a gluster vds command that manipulates the cluster state
b) Update engine DB with the changes

then it must be annotated with @RequireGlusterManagerLock

Change-Id: I57b3bd0b9e384ff130c4083147ac228a81185a2d
Signed-off-by: Shireesh Anjal <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterManager.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommand.java
A 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RequireGlusterManagerLock.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommand.java
16 files changed, 145 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/82/9782/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommand.java
index cb1665d..a67f001 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/AddBricksToGlusterVolumeCommand.java
@@ -4,6 +4,7 @@
 import java.util.List;
 
 import org.ovirt.engine.core.bll.Backend;
+import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.common.AuditLogType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeBricksActionParameters;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity;
@@ -17,6 +18,8 @@
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.dal.VdcBllMessages;
 
+@NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class AddBricksToGlusterVolumeCommand extends 
GlusterVolumeCommandBase<GlusterVolumeBricksActionParameters> {
 
     private static final long serialVersionUID = 1798863209150948961L;
@@ -62,7 +65,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 Backend
                         .getInstance()
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommand.java
index 2831c53..5c4642c 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeCommand.java
@@ -29,6 +29,7 @@
  * BLL command to create a new Gluster Volume
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class CreateGlusterVolumeCommand extends 
GlusterCommandBase<CreateGlusterVolumeParameters> {
 
     private static final long serialVersionUID = 7432566785114684972L;
@@ -100,7 +101,7 @@
      * @see org.ovirt.engine.core.bll.CommandBase#executeCommand()
      */
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         // set the gluster volume name for audit purpose
         setGlusterVolumeName(volume.getName());
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommand.java
index 5a23b41..35d1c32 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/DeleteGlusterVolumeCommand.java
@@ -14,6 +14,7 @@
  * BLL command to delete a Gluster volume
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class DeleteGlusterVolumeCommand extends 
GlusterVolumeCommandBase<GlusterVolumeParameters> {
 
     private static final long serialVersionUID = -4045244619084727618L;
@@ -44,7 +45,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 runVdsCommand(
                         VDSCommandType.DeleteGlusterVolume,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
index a7591d7..3d72edc 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterCommandBase.java
@@ -8,8 +8,8 @@
 import org.ovirt.engine.core.bll.Backend;
 import org.ovirt.engine.core.bll.CommandBase;
 import org.ovirt.engine.core.bll.utils.ClusterUtils;
-import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.bll.utils.PermissionSubject;
+import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.VdcObjectType;
 import org.ovirt.engine.core.common.action.VdcActionParametersBase;
 import org.ovirt.engine.core.common.action.VdcActionType;
@@ -75,6 +75,39 @@
     }
 
     /**
+     * Enforces the logic to <br>
+     * <li>acquire a lock on GlusterManager before executing the command 
logic</li><br>
+     * <li>and release it in the end</li><br>
+     * wherever required i.e. if the command has the annotation {@link 
RequireGlusterManagerLock} defined on it.
+     * <p>
+     *
+     * @see GlusterManager
+     * @see RequireGlusterManagerLock
+     */
+    @Override
+    protected final void executeCommand() {
+        boolean lockRequired = checkGlusterManagerLockRequired();
+
+        if (lockRequired) {
+            GlusterManager.getInstance().acquireLock();
+        }
+
+        try {
+            executeGlusterCommand();
+        } finally {
+            if (lockRequired) {
+                GlusterManager.getInstance().releaseLock();
+            }
+        }
+    }
+
+    private boolean checkGlusterManagerLockRequired() {
+        return getClass().getAnnotation(RequireGlusterManagerLock.class) != 
null;
+    }
+
+    protected abstract void executeGlusterCommand();
+
+    /**
      * Executes given BLL action, updates the success flag based on the 
result, and returns the result
      *
      * @param actionType
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterManager.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterManager.java
index e425a40..706ee59 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterManager.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterManager.java
@@ -9,6 +9,7 @@
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.ReentrantLock;
 
 import org.ovirt.engine.core.bll.Backend;
 import org.ovirt.engine.core.bll.job.ExecutionHandler;
@@ -67,12 +68,50 @@
  * This class is responsible for keeping the Gluster related data of engine in 
sync with the actual data retrieved from
  * GlusterFS. This helps to make sure that any changes done on Gluster servers 
using the Gluster CLI are propagated to
  * engine as well.
+ * <p>
+ * This can potentially interfere with BLL commands that execute a gluster 
command and then update DB with appropriate
+ * changes. Hence it is required that all such gluster BLL commands acquire a 
lock before performing their logic, and
+ * release it in the end. This is enforced by {@link 
GlusterCommandBase#executeCommand()} and
+ * {@link RequireGlusterManagerLock}. <br>
+ *
+ * @see GlusterCommandBase#executeCommand()
+ * @see RequireGlusterManagerLock
+ * @see GlusterManager#acquireLock()
  */
 public class GlusterManager {
     private static final String ENTITY_BRICK = "brick";
     private static final String ENTITY_OPTION = "option";
     private static final GlusterManager instance = new GlusterManager();
     private static final Log log = LogFactory.getLog(GlusterManager.class);
+    private static final ReentrantLock lock = new ReentrantLock(true);
+
+    /**
+     * Acquire a lock. Any piece of code that does <br>
+     * <li>Execute a gluster command which manipulates the status of the 
cluster</li> <li>and updates the database with
+     * the changes</li> OR <li>Executes a gluster command to fetch latest 
information from glusterfs</li> <li>Updates
+     * the engine DB to bring it in sync with glusterfs</li> <br>
+     * Should first acquire the lock, perform the above two actions, and then 
release the lock.
+     * <p>
+     * e.g.
+     * <p>
+     *
+     * <pre>
+     * GlusterManager.getInstance().acquireLock();
+     * try {
+     *     // execute gluster vds command
+     *     // update the db
+     * } finally {
+     *     GlusterManager.getInstance().releaseLock();
+     * }
+     * </pre>
+     */
+    protected void acquireLock() {
+        lock.lock();
+    }
+
+    protected void releaseLock() {
+        lock.unlock();
+    }
 
     private GlusterManager() {
     }
@@ -174,9 +213,14 @@
             return;
         }
 
-        List<GlusterServerInfo> fetchedServers = fetchServers(cluster, 
upServer, existingServers);
-        if (fetchedServers != null) {
-            removeDetachedServers(existingServers, fetchedServers);
+        acquireLock();
+        try {
+            List<GlusterServerInfo> fetchedServers = fetchServers(cluster, 
upServer, existingServers);
+            if (fetchedServers != null) {
+                removeDetachedServers(existingServers, fetchedServers);
+            }
+        } finally {
+            releaseLock();
         }
     }
 
@@ -363,16 +407,21 @@
     }
 
     private void refreshVolumeData(VDSGroup cluster, VDS upServer, List<VDS> 
existingServers) {
-        // Pass a copy of the existing servers as the fetchVolumes method can 
potentially remove elements from it
-        Map<String, GlusterVolumeEntity> volumesMap = fetchVolumes(upServer, 
new ArrayList<VDS>(existingServers));
-        if (volumesMap == null) {
-            log.errorFormat("gluster volume info command failed on all servers 
of the cluster {0}."
-                    + "Can't refresh it's data at this point.", 
cluster.getname());
-            return;
-        }
+        acquireLock();
+        try {
+            // Pass a copy of the existing servers as the fetchVolumes method 
can potentially remove elements from it
+            Map<String, GlusterVolumeEntity> volumesMap = 
fetchVolumes(upServer, new ArrayList<VDS>(existingServers));
+            if (volumesMap == null) {
+                log.errorFormat("gluster volume info command failed on all 
servers of the cluster {0}."
+                        + "Can't refresh it's data at this point.", 
cluster.getname());
+                return;
+            }
 
-        updateExistingAndNewVolumes(cluster.getId(), volumesMap);
-        removeDeletedVolumes(cluster.getId(), volumesMap);
+            updateExistingAndNewVolumes(cluster.getId(), volumesMap);
+            removeDeletedVolumes(cluster.getId(), volumesMap);
+        } finally {
+            releaseLock();
+        }
     }
 
     /**
@@ -779,6 +828,7 @@
                 log.debugFormat("Refreshing brick statuses for volume {0} of 
cluster {1}",
                         volume.getName(),
                         cluster.getname());
+                acquireLock();
                 try {
                     refreshBrickStatuses(upServer, volume);
                 } catch (Exception e) {
@@ -786,6 +836,8 @@
                             volume.getName(),
                             cluster.getname(),
                             e);
+                } finally {
+                    releaseLock();
                 }
             }
         }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommand.java
index da29710..35a034a 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterVolumeRemoveBricksCommand.java
@@ -19,6 +19,7 @@
  * BLL command to Remove Bricks from Gluster volume
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class GlusterVolumeRemoveBricksCommand extends 
GlusterVolumeCommandBase<GlusterVolumeRemoveBricksParameters> {
     private static final long serialVersionUID = 1465299601226267507L;
     private List<GlusterBrickEntity> bricks = new 
ArrayList<GlusterBrickEntity>();
@@ -67,7 +68,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         int replicaCount =
                 (getGlusterVolume().getVolumeType() == 
GlusterVolumeType.REPLICATE
                 || getGlusterVolume().getVolumeType() == 
GlusterVolumeType.DISTRIBUTED_REPLICATE)
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommand.java
index 5ae2a4d..74e4ab7 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RemoveGlusterServerCommand.java
@@ -13,6 +13,7 @@
  * BLL command for gluster peer detach
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class RemoveGlusterServerCommand extends 
GlusterCommandBase<RemoveGlusterServerParameters> {
 
     private static final long serialVersionUID = -3658615659129620366L;
@@ -40,7 +41,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 runVdsCommand(VDSCommandType.RemoveGlusterServer,
                         new RemoveGlusterServerVDSParameters(upServer.getId(),
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommand.java
index 22f9cfa..a48894f 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ReplaceGlusterVolumeBrickCommand.java
@@ -64,7 +64,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 runVdsCommand(
                         VDSCommandType.ReplaceGlusterVolumeBrick,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RequireGlusterManagerLock.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RequireGlusterManagerLock.java
new file mode 100644
index 0000000..359d8f1
--- /dev/null
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/RequireGlusterManagerLock.java
@@ -0,0 +1,23 @@
+package org.ovirt.engine.core.bll.gluster;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * This annotation can be added on any gluster related BLL command, if it 
performs the following two activities:<br>
+ * <li>Execute gluster command that results in changes to the gluster 
cluster</li><br>
+ * <li>Update the DB with these changes</li><br>
+ * It makes sure that the {@link GlusterCommandBase#executeAction()} acquires 
a lock on {@link GlusterManager} before
+ * executing the command logic, and releases it in the end. <br>
+ * <br>
+ *
+ * @see GlusterCommandBase#executeAction()
+ * @see GlusterManager
+ */
+@Target(ElementType.TYPE)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface RequireGlusterManagerLock {
+
+}
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
index 4ee71ae..7f469f1 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/ResetGlusterVolumeOptionsCommand.java
@@ -13,6 +13,7 @@
  * BLL Command to Reset Gluster Volume Options
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class ResetGlusterVolumeOptionsCommand extends 
GlusterVolumeCommandBase<ResetGlusterVolumeOptionsParameters> {
 
     private static final long serialVersionUID = 7051669924582153802L;
@@ -28,7 +29,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue = 
runVdsCommand(VDSCommandType.ResetGlusterVolumeOptions,
                 new ResetGlusterVolumeOptionsVDSParameters(upServer.getId(),
                         getGlusterVolumeName(), 
getParameters().getVolumeOption(), getParameters().isForceAction()));
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
index 4a90417..02a83ca 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SetGlusterVolumeOptionCommand.java
@@ -13,6 +13,7 @@
  * BLL Command to set a Gluster Volume Option
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class SetGlusterVolumeOptionCommand extends 
GlusterVolumeCommandBase<GlusterVolumeOptionParameters> {
     private static final long serialVersionUID = 1072922951605958813L;
 
@@ -32,7 +33,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue = 
runVdsCommand(VDSCommandType.SetGlusterVolumeOption,
                 new GlusterVolumeOptionVDSParameters(upServer.getId(),
                         getGlusterVolumeName(), 
getParameters().getVolumeOption()));
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
index ca08bd2..98830e5 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeCommand.java
@@ -15,6 +15,7 @@
  * BLL command to start a Gluster volume
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class StartGlusterVolumeCommand extends 
GlusterVolumeCommandBase<GlusterVolumeActionParameters> {
 
     private static final long serialVersionUID = -7109431150062113267L;
@@ -45,7 +46,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                                 runVdsCommand(
                                         VDSCommandType.StartGlusterVolume,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommand.java
index 91c3790..da7fb8d 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartGlusterVolumeProfileCommand.java
@@ -27,7 +27,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 runVdsCommand(VDSCommandType.StartGlusterVolumeProfile,
                         new GlusterVolumeVDSParameters(upServer.getId(), 
getGlusterVolumeName()));
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommand.java
index 5b7ba17..2fa3307 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StartRebalanceGlusterVolumeCommand.java
@@ -50,7 +50,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                                 runVdsCommand(
                                         
VDSCommandType.StartRebalanceGlusterVolume,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
index 7c7a4ba..faea800 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeCommand.java
@@ -15,6 +15,7 @@
  * BLL command to stop a Gluster volume
  */
 @NonTransactiveCommandAttribute
+@RequireGlusterManagerLock
 public class StopGlusterVolumeCommand extends 
GlusterVolumeCommandBase<GlusterVolumeActionParameters> {
 
     private static final long serialVersionUID = -7385050813049055828L;
@@ -45,7 +46,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                                 runVdsCommand(
                                         VDSCommandType.StopGlusterVolume,
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommand.java
index e579369..ec120e0 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StopGlusterVolumeProfileCommand.java
@@ -27,7 +27,7 @@
     }
 
     @Override
-    protected void executeCommand() {
+    protected void executeGlusterCommand() {
         VDSReturnValue returnValue =
                 runVdsCommand(VDSCommandType.StopGlusterVolumeProfile,
                         new GlusterVolumeVDSParameters(upServer.getId(), 
getGlusterVolumeName()));


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

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

Reply via email to