You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/01/18 13:40:18 UTC

[GitHub] [hadoop] tomscut commented on a change in pull request #3883: HDFS-16423. Balancer should not get blocks on stale storages

tomscut commented on a change in pull request #3883:
URL: https://github.com/apache/hadoop/pull/3883#discussion_r786768096



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
##########
@@ -1680,8 +1687,8 @@ public BlocksWithLocations getBlocksWithLocations(final DatanodeID datanode,
       }
     }
     if(totalSize<size) {
-      iter = node.getBlockIterator(); // start from the beginning
-      for(int i=0; i<startBlock&&totalSize<size; i++) {
+      iter = node.getBlockIterator(0, storageInfos); // start from the beginning
+      for(int i=0; i<startBlock&&totalSize<size&&iter.hasNext(); i++) {

Review comment:
       Please add blank spaces to correct the code format. Thanks.




-- 
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: common-issues-unsubscribe@hadoop.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org