Eli Mesika has uploaded a new change for review.

Change subject: core: Fence via second power management not work...
......................................................................

core: Fence via second power management not work...

Fence via second power management not working

Adding a check for status 'unknown", if we get this status we can be
sure that agent definitions are corrupted and exit the wait for status
loop.
Fixing the way the dual sequential agents work by reseting the executor
object to perform the original operation (actually recreating it with
the correct action before handling the other secondary agent)

Change-Id: I97c05e96e2c8d5f690addda61e0dd577c423ff07
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=982604
Signed-off-by: root <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
1 file changed, 16 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/81/18481/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
index ead18cb..283fdd5 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
@@ -216,6 +216,8 @@
                 if (waitForStatus(getVds().getName(), 
getParameters().getAction(), FenceAgentOrder.Primary)) {
                     handleSpecificCommandActions();
                 } else {
+                    // set the executor to perform the action
+                    executor = new FenceExecutor(getVds(), 
getParameters().getAction());
                     tryOtherSequentialAgent(lastStatus);
                 }
             } else {
@@ -514,13 +516,20 @@
                 VDSReturnValue returnValue = executor.Fence(order);
                 if (returnValue != null && returnValue.getReturnValue() != 
null) {
                     FenceStatusReturnValue value = (FenceStatusReturnValue) 
returnValue.getReturnValue();
-                    if (FENCE_CMD.equalsIgnoreCase(value.getStatus())) {
-                        statusReached = true;
-                        log.infoFormat("vds {0} status is {1}", vdsName, 
FENCE_CMD);
-                    } else {
-                        i++;
-                        if (i <= getRerties())
-                            ThreadUtils.sleep(getDelayInSeconds() * 1000);
+                    if (value.getStatus().equalsIgnoreCase("unknown")) {
+                        // No need to retry , agent definitions are corrupted
+                        log.warnFormat("Host {0} {1} PM Agent definitions are 
corrupted, Waiting for Host to {2) aborted.", vdsName, order.name(), 
actionType.name());
+                        break;
+                    }
+                    else {
+                        if (FENCE_CMD.equalsIgnoreCase(value.getStatus())) {
+                            statusReached = true;
+                            log.infoFormat("vds {0} status is {1}", vdsName, 
FENCE_CMD);
+                        } else {
+                            i++;
+                            if (i <= getRerties())
+                                ThreadUtils.sleep(getDelayInSeconds() * 1000);
+                        }
                     }
                 } else {
                     log.errorFormat("Failed to get host {0} status.", vdsName);


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

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

Reply via email to