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
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1031632
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, 19 insertions(+), 18 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/68/21368/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 37c9dcd..f9435a9 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
@@ -35,7 +35,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;
@@ -216,17 +215,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
@@ -238,8 +235,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);
@@ -263,19 +260,23 @@
         return returnValue;
     }
 
-    protected boolean proceedVdsStats() {
+    protected boolean proceedVdsStats(boolean shouldCheckReportedDomains) {
         boolean returnValue = true;
         try {
             runVdsCommand(VDSCommandType.GetStats, new 
VdsIdAndVdsVDSCommandParametersBase(getVds()));
-            List<Guid> problematicDomainsIds = 
IrsBrokerCommand.fetchDomainsReportedAsProblematic(getVds().getStoragePoolId(), 
getVds().getDomains());
-            for (Guid domainId : problematicDomainsIds) {
-                StorageDomainStatic domainInfo = 
getStorageDomainStaticDAO().get(domainId);
-                log.errorFormat("Storage Domain {0} of pool {1} is in problem 
in host {2}",
-                        domainInfo != null ? domainInfo.getStorageName() : 
domainId,
-                        getStoragePool().getName(),
-                        getVds().getName());
-                if (domainInfo == null || 
domainInfo.getStorageDomainType().isDataDomain()) {
-                    returnValue = false;
+            if (shouldCheckReportedDomains) {
+                List<Guid> problematicDomainsIds =
+                        
IrsBrokerCommand.fetchDomainsReportedAsProblematic(getVds().getStoragePoolId(),
+                                getVds().getDomains());
+                for (Guid domainId : problematicDomainsIds) {
+                    StorageDomainStatic domainInfo = 
getStorageDomainStaticDAO().get(domainId);
+                    log.errorFormat("Storage Domain {0} of pool {1} is in 
problem in host {2}",
+                            domainInfo != null ? domainInfo.getStorageName() : 
domainId,
+                            getStoragePool().getName(),
+                            getVds().getName());
+                    if (domainInfo == null || 
domainInfo.getStorageDomainType().isDataDomain()) {
+                        returnValue = false;
+                    }
                 }
             }
         } catch (VdcBLLException e) {


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

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

Reply via email to