Liron Ar has uploaded a new change for review.

Change subject: core: InitVdsOnUp - flow fixes
......................................................................

core: InitVdsOnUp - flow fixes

1. If the master domain is inactive/unknown - a host shouldn't fail this
phase of the flow if it respondes to getVdsStats.

2. If the master domain is inactive/unknown - the host shouldn't fail
the flow according to it's domain report.

Examples for relevant scenarios:

1. When there are no active hosts, all the domains are marked as
"unknown", if we will attempt to activate a host and it won't be able to
connect to the pool because of VDS_NETWORK_ERROR, the host won't move to
UP because of the check of it's domain report.

2. When there are no active hosts and a host is being activated,
successfully connects to the pool and it can't see any of the domains
it won't move to UP because of it's domain report.

Change-Id: I61fcc58be133efdecf264c22015609f6ee3ed942
Signed-off-by: Liron Aravot <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
1 file changed, 8 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/65/18165/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
index 022d7d7..1129095 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
@@ -17,6 +17,7 @@
 import org.ovirt.engine.core.common.action.HostStoragePoolParametersBase;
 import org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters;
 import org.ovirt.engine.core.common.action.VdcActionType;
+import org.ovirt.engine.core.common.businessentities.AttestationResultEnum;
 import org.ovirt.engine.core.common.businessentities.FenceActionType;
 import org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue;
 import org.ovirt.engine.core.common.businessentities.NonOperationalReason;
@@ -33,7 +34,6 @@
 import org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo;
 import 
org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface;
 import org.ovirt.engine.core.common.errors.VdcBLLException;
-import org.ovirt.engine.core.common.errors.VdcBllErrors;
 import org.ovirt.engine.core.common.eventqueue.Event;
 import org.ovirt.engine.core.common.eventqueue.EventQueue;
 import org.ovirt.engine.core.common.eventqueue.EventResult;
@@ -60,7 +60,6 @@
 import org.ovirt.engine.core.vdsbroker.attestation.AttestationService;
 import org.ovirt.engine.core.vdsbroker.attestation.AttestationValue;
 import org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand;
-import org.ovirt.engine.core.common.businessentities.AttestationResultEnum;
 
 /**
  * Initialize Vds on its loading. For storages: First connect all storage
@@ -215,17 +214,15 @@
         EventResult result = new EventResult(true, EventType.VDSCONNECTTOPOOL);
         StoragePool storagePool = getStoragePoolDAO().get(storagePoolId);
         StorageDomain masterDomain = 
getStorageDomainDAO().getStorageDomainByTypeAndPool(storagePoolId, 
StorageDomainType.Master);
-        boolean shouldProceedVdsStats = true;
+        boolean masterDomainInactiveOrUnknown = masterDomain.getStatus() == 
StorageDomainStatus.InActive
+                || masterDomain.getStatus() == StorageDomainStatus.Unknown;
         try {
             runVdsCommand(VDSCommandType.ConnectStoragePool,
                     new ConnectStoragePoolVDSCommandParameters(vds.getId(), 
storagePoolId,
                             vds.getVdsSpmId(), masterDomain.getId(),
                             storagePool.getmaster_domain_version()));
         } catch (VdcBLLException e) {
-            if (e.getErrorCode() != VdcBllErrors.VDS_NETWORK_ERROR &&
-                    (masterDomain.getStatus() == StorageDomainStatus.InActive
-                    || masterDomain.getStatus() == 
StorageDomainStatus.Unknown)) {
-                shouldProceedVdsStats = false;
+            if (masterDomainInactiveOrUnknown) {
                 log.infoFormat("Could not connect host {0} to pool {1}, as the 
master domain is in inactive/unknown status - not failing the operation",
                         vds.getName(),
                         storagePool
@@ -237,8 +234,8 @@
             }
         }
 
-        if (result.isSuccess() && shouldProceedVdsStats) {
-            result.setSuccess(proceedVdsStats());
+        if (result.isSuccess()) {
+            result.setSuccess(proceedVdsStats(masterDomainInactiveOrUnknown));
             if (!result.isSuccess()) {
                 AuditLogDirector.log(new AuditLogableBase(getVdsId()),
                         AuditLogType.VDS_STORAGE_VDS_STATS_FAILED);
@@ -262,11 +259,11 @@
         return returnValue;
     }
 
-    protected boolean proceedVdsStats() {
+    protected boolean proceedVdsStats(boolean shouldCheckReportedDomains) {
         boolean returnValue = true;
         try {
             runVdsCommand(VDSCommandType.GetStats, new 
VdsIdAndVdsVDSCommandParametersBase(getVds()));
-            if 
(IrsBrokerCommand.isDomainsReportedAsProblematic(getVds().getStoragePoolId(), 
getVds().getDomains())) {
+            if (shouldCheckReportedDomains && 
IrsBrokerCommand.isDomainsReportedAsProblematic(getVds().getStoragePoolId(), 
getVds().getDomains())) {
                 log.errorFormat("One of the Storage Domains of host {0} in 
pool {1} is problematic",
                         getVds().getName(),
                         getStoragePool()


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61fcc58be133efdecf264c22015609f6ee3ed942
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

Reply via email to