devmadhuu commented on code in PR #12062:
URL: https://github.com/apache/ozone/pull/12062#discussion_r4665270890


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/balancer/ContainerBalancerSelectionCriteria.java:
##########
@@ -190,6 +200,21 @@ private Comparator<ContainerID> 
orderContainersByUsedBytes() {
    */
   public boolean shouldBeExcluded(ContainerID containerID,
       DatanodeDetails node, long sizeMovedAlready) {
+    return shouldBeExcluded(containerID, node, sizeMovedAlready, null);
+  }
+
+  /**
+   * As {@link #shouldBeExcluded(ContainerID, DatanodeDetails, long)}, but also
+   * excludes containers whose replica on {@code node} is not on
+   * {@code storageType}. The balancer uses this to move data within one 
storage
+   * tier at a time, so a move never relocates data to a different tier.
+   *
+   * @param storageType the storage type being balanced, or null to consider
+   *                    containers on any storage type
+   */
+  public boolean shouldBeExcluded(ContainerID containerID,

Review Comment:
   > Candidate caching is now separated by source and storage type. However, 
failure exclusions appear to remain at the container level. Consider this 
scenario:
   > 
   >     1. A container has replicas on different storage types.
   > 
   >     2. An SSD move fails due to a storage-type mismatch.
   > 
   >     3. The container is added to the global failure-exclusion set.
   > 
   >     4. The subsequent DISK pass also skips that container.
   Yes I think you are right, an SSD mismatch skipped the container's DISK 
replica for the rest of the iteration. A mismatch is about one source replica's 
type, not the container, so I now track it per storage type. Health failures 
stay container-wide. 



-- 
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