errose28 commented on code in PR #7127:
URL: https://github.com/apache/ozone/pull/7127#discussion_r1811367289


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/BackgroundContainerDataScanner.java:
##########
@@ -87,27 +87,30 @@ public void scanContainer(Container<?> c)
     ContainerData containerData = c.getContainerData();
     long containerId = containerData.getContainerID();
     logScanStart(containerData);
-    ScanResult result = c.scanData(throttler, canceler);
-
-    // Metrics for skipped containers should not be updated.
-    if (result.getFailureType() == DELETED_CONTAINER) {
-      LOG.error("Container [{}] has been deleted.",
-          containerId, result.getException());
-      return;
-    }
-    if (!result.isHealthy()) {
-      LOG.error("Corruption detected in container [{}]. Marking it UNHEALTHY.",
-          containerId, result.getException());
-      boolean containerMarkedUnhealthy = 
controller.markContainerUnhealthy(containerId, result);
-      if (containerMarkedUnhealthy) {
-        metrics.incNumUnHealthyContainers();
+    DataScanResult result = c.scanData(throttler, canceler);
+
+    if (result.isDeleted()) {
+      LOG.debug("Container [{}] has been deleted during the data scan.", 
containerId);
+    } else {
+      if (!result.isHealthy()) {
+        logUnhealthyScanResult(containerId, result, LOG);
+
+        // Only increment the number of unhealthy containers if the container 
was not already unhealthy.
+        if (controller.markContainerUnhealthy(containerId, result)) {
+          metrics.incNumUnHealthyContainers();

Review Comment:
   I've added a TODO here about how #7335 will change the way this metric is 
used when we merge it in from master.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to