Greg Padgett has uploaded a new change for review.

Change subject: core: log domain name during error in irsbroker (#854025)
......................................................................

core: log domain name during error in irsbroker (#854025)

https://bugzilla.redhat.com/854025

Log storage domain GUID and name in irsbroker to make troubleshooting
and debugging easier.

Change-Id: Ic1943d779237c686a21ea74168ed48a0ac45c202
Signed-off-by: Greg Padgett <gpadg...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
1 file changed, 25 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/98/7998/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
index 3659a3f..d8e8079 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/irsbroker/IrsBrokerCommand.java
@@ -1183,12 +1183,13 @@
         }
 
         private void DomainRecoveredFromProblem(Guid domainId, Guid vdsId, 
String vdsName) {
-            log.infoFormat("Domain {0} recovered from problem. vds: {1}", 
domainId, vdsName);
+            String domainIdTuple = getDomainIdTuple(domainId);
+            log.infoFormat("Domain {0} recovered from problem. vds: {1}", 
domainIdTuple, vdsName);
             ClearVds(vdsId, domainId);
             _domainsInProblem.get(domainId).remove(vdsId);
             if (_domainsInProblem.get(domainId).size() == 0) {
                 log.infoFormat("Domain {0} has recovered from problem. No 
active host in the DC is reporting it as" +
-                        " problematic, so clearing the domain recovery 
timer.", domainId);
+                        " problematic, so clearing the domain recovery 
timer.", domainIdTuple);
                 _domainsInProblem.remove(domainId);
                 ClearTimer(domainId);
             }
@@ -1197,7 +1198,7 @@
         private void AddDomainInProblemData(Guid domainId, Guid vdsId, String 
vdsName) {
             UpdateVdsInProblem(domainId, vdsId);
             _domainsInProblem.put(domainId, new 
java.util.HashSet<Guid>(java.util.Arrays.asList(vdsId)));
-            log.warnFormat("domain {0} in problem. vds: {1}", domainId, 
vdsName);
+            log.warnFormat("domain {0} in problem. vds: {1}", 
getDomainIdTuple(domainId), vdsName);
             Class[] inputType = new Class[] { Guid.class };
             Object[] inputParams = new Object[] { domainId };
             String jobId = 
SchedulerUtilQuartzImpl.getInstance().scheduleAOneTimeJob(this, "OnTimer", 
inputType,
@@ -1211,7 +1212,7 @@
         public void OnTimer(Guid domainId) {
             synchronized (_lockObject) {
                 if (_domainsInProblem.containsKey(domainId)) {
-                    log.info("starting ProcessDomainRecovery for domain " + 
domainId);
+                    log.info("starting ProcessDomainRecovery for domain " + 
getDomainIdTuple(domainId));
                     ProcessDomainRecovery(domainId);
                 }
                 _timers.remove(domainId);
@@ -1219,7 +1220,7 @@
         }
 
         private void UpdateDomainInProblemData(Guid domainId, Guid vdsId, 
String vdsName) {
-            log.debugFormat("domain {0} still in problem. vds: {1}", domainId, 
vdsName);
+            log.debugFormat("domain {0} still in problem. vds: {1}", 
getDomainIdTuple(domainId), vdsName);
             _domainsInProblem.get(domainId).add(vdsId);
             UpdateVdsInProblem(domainId, vdsId);
         }
@@ -1264,6 +1265,7 @@
                     // that did report on a problem with this domain.
                     // (and not a problem with the domain itself).
                     storage_domain_static storageDomain = 
DbFacade.getInstance().getStorageDomainStaticDAO().get(domainId);
+                    String domainIdTuple = getDomainIdTuple(domainId);
                     if (vdssInProblem.size() > 0) {
                         if (storageDomain.getstorage_domain_type() != 
StorageDomainType.ImportExport
                                 && storageDomain.getstorage_domain_type() != 
StorageDomainType.ISO) {
@@ -1276,17 +1278,15 @@
                                 VDS vds = 
DbFacade.getInstance().getVdsDAO().get(vdsId);
                                 if (vds == null) {
                                     log.warnFormat(
-                                            "vds {0} reported domain {1}:{2} - 
as in problem but cannot find vds in db!!",
+                                            "vds {0} reported domain {1} - as 
in problem but cannot find vds in db!!",
                                             vdsId,
-                                            domainId,
-                                            storageDomain.getstorage_name());
+                                            domainIdTuple);
                                 } else if (vds.getstatus() != 
VDSStatus.Maintenance
                                         && vds.getstatus() != 
VDSStatus.NonOperational) {
                                     log.warnFormat(
-                                            "vds {0} reported domain {1}:{2} 
as in problem, moving the vds to status NonOperational",
+                                            "vds {0} reported domain {1} as in 
problem, moving the vds to status NonOperational",
                                             vds.getvds_name(),
-                                            domainId,
-                                            storageDomain.getstorage_name());
+                                            domainIdTuple);
                                     ResourceManager
                                             .getInstance()
                                             .getEventListener()
@@ -1295,10 +1295,9 @@
                                     clearVdsFromCache(vdsId, 
vds.getvds_name());
                                 } else {
                                     log.warnFormat(
-                                            "vds {0} reported domain {1}:{2} 
as in problem, vds is in status {3}, no need to move to nonoperational",
+                                            "vds {0} reported domain {1} as in 
problem, vds is in status {2}, no need to move to nonoperational",
                                             vds.getvds_name(),
-                                            domainId,
-                                            storageDomain.getstorage_name(),
+                                            domainIdTuple,
                                             vds.getstatus());
                                 }
                             }
@@ -1306,7 +1305,7 @@
                             log.warnFormat(
                                     "Storage domain {0} is not visible to one 
or more hosts. " +
                                     "Since the domain's type is {1}, hosts 
status will not be changed to non-operational",
-                                    storageDomain.getstorage_name(),
+                                    domainIdTuple,
                                     storageDomain.getstorage_domain_type());
                         }
 
@@ -1316,7 +1315,7 @@
                              // Domain.
                         if (storageDomain.getstorage_domain_type() != 
StorageDomainType.Master) {
                             log.warnFormat("domain {0} was reported by all 
hosts in status UP as problematic. Moving the Domain to NonOperational.",
-                                            domainId);
+                                            domainIdTuple);
                             ResourceManager.getInstance()
                                     
.getEventListener().storageDomainNotOperational(domainId, _storagePoolId);
                         } else if 
(duringReconstructMaster.compareAndSet(false, true)) {
@@ -1328,7 +1327,7 @@
                             }
                         } else {
                             log.warnFormat("domain {0} was reported by all 
hosts in status UP as problematic. But not moving the Domain to NonOperational. 
Because of is reconstract now",
-                                                               domainId);
+                                    domainIdTuple);
                             return null;
                         }
                     }
@@ -1447,6 +1446,15 @@
             }
         }
 
+        private String getDomainIdTuple(Guid domainId) {
+            storage_domain_static storage_domain = 
DbFacade.getInstance().getStorageDomainStaticDAO().get(domainId);
+            if (storage_domain != null) {
+                return domainId + ":" + storage_domain.getstorage_name();
+            } else {
+                return domainId.toString();
+            }
+        }
+
     }
 
     /**


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic1943d779237c686a21ea74168ed48a0ac45c202
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Greg Padgett <gpadg...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to