aryangupta1998 commented on code in PR #8442:
URL: https://github.com/apache/ozone/pull/8442#discussion_r2093623024


##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OnDemandContainerScanner.java:
##########
@@ -135,13 +137,18 @@ private static void performOnDemandScan(Container<?> 
container) {
       ContainerData containerData = container.getContainerData();
       logScanStart(containerData);
 
-      ScanResult result =
-          container.scanData(instance.throttler, instance.canceler);
-      // Metrics for skipped containers should not be updated.
-      if (result.getFailureType() == DELETED_CONTAINER) {
-        LOG.error("Container [{}] has been deleted.",
-            containerId, result.getException());
-        return;
+      ScanResult result = ScanResult.healthy();
+      // OPEN containers are scanned here for metadata only
+      if (container.shouldScanMetadata() && !container.shouldScanData()) {
+        result = container.scanMetaData();
+      } else if (container.shouldScanData()) {
+        result = container.scanData(instance.throttler, instance.canceler);

Review Comment:
   ```suggestion
         if (container.shouldScanData()) {
             result = container.scanData(instance.throttler, instance.canceler);
         } else if (container.shouldScanMetadata()) {
             result = container.scanMetaData();
      }
   ```



##########
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/OnDemandContainerScanner.java:
##########
@@ -135,13 +137,18 @@ private static void performOnDemandScan(Container<?> 
container) {
       ContainerData containerData = container.getContainerData();
       logScanStart(containerData);
 
-      ScanResult result =
-          container.scanData(instance.throttler, instance.canceler);
-      // Metrics for skipped containers should not be updated.
-      if (result.getFailureType() == DELETED_CONTAINER) {
-        LOG.error("Container [{}] has been deleted.",
-            containerId, result.getException());
-        return;
+      ScanResult result = ScanResult.healthy();
+      // OPEN containers are scanned here for metadata only
+      if (container.shouldScanMetadata() && !container.shouldScanData()) {
+        result = container.scanMetaData();

Review Comment:
   Not necessary, but if you want, you may add a debug log.
   `LOG.debug("Performing metadata-only scan for open container {}", 
container.getContainerID());`



-- 
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: issues-unsubscr...@ozone.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@ozone.apache.org
For additional commands, e-mail: issues-h...@ozone.apache.org

Reply via email to