Arik Hadas has uploaded a new change for review.

Change subject: core: fix reattempt to go to maintenance mechanism
......................................................................

core: fix reattempt to go to maintenance mechanism

We used to calculate the time from which we should retry to switch the
host to maintenance in case of failure while changing the status of the
host from preparing to maintenance to other status. This is wrong. We
should calculate it when we set the host's status to preparing to
maintenance.

Change-Id: I39835028d5696b9e7a3473852ccf5bf70d3d74d4
Bug-Url: https://bugzilla.redhat.com/1110126
Signed-off-by: Arik Hadas <[email protected]>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
1 file changed, 4 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/37/28837/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
index 71b9cae..b88b000 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VdsManager.java
@@ -398,14 +398,13 @@
             if (vds == null) {
                 vds = DbFacade.getInstance().getVdsDao().get(getVdsId());
             }
-            if (vds.getPreviousStatus() != vds.getStatus()) {
+            if (vds.getStatus() != status) {
+                if (status == VDSStatus.PreparingForMaintenance) {
+                    calculateNextMaintenanceAttemptTime();
+                }
                 vds.setPreviousStatus(vds.getStatus());
                 if (_vds != null) {
                     _vds.setPreviousStatus(vds.getStatus());
-                    if (_vds.getStatus() == VDSStatus.PreparingForMaintenance) 
{
-                        calculateNextMaintenanceAttemptTime();
-                    }
-
                 }
             }
             // update to new status


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

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

Reply via email to