-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDFS-16423. Balancer should not get blocks on stale storages #3883
Conversation
2159b9d
to
30c8dce
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
2b4793d
to
11ef2f0
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
11ef2f0
to
3d35dae
Compare
💔 -1 overall
This message was automatically generated. |
3d35dae
to
fd3415a
Compare
💔 -1 overall
This message was automatically generated. |
@tasanuma @Hexiaoqiao Please take a look. |
@liubingxing Thanks for the PR. It is a kind of bug, and I don't think we need to make it configurable. |
fd3415a
to
51eeeb4
Compare
🎊 +1 overall
This message was automatically generated. |
@tasanuma Thanks for your comment, I update the PR, Please take a look. |
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++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add blank spaces to correct the code format. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the advice, I update the code, please review again.
51eeeb4
to
8d4b69d
Compare
+1, pending Jenkins. |
🎊 +1 overall
This message was automatically generated. |
Merged it. Thanks for your contribution, @liubingxing, and thanks for your review, @tomscut. |
…3883) Reviewed-by: litao <[email protected]> Signed-off-by: Takanobu Asanuma <[email protected]> (cherry picked from commit db2c320) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestGetBlocks.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithHANameNodes.java
…3924) Reviewed-by: litao <[email protected]> Signed-off-by: Takanobu Asanuma <[email protected]> (cherry picked from commit db2c320) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestGetBlocks.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithHANameNodes.java Co-authored-by: qinyuren <[email protected]>
…3883) (apache#3924) Reviewed-by: litao <[email protected]> Signed-off-by: Takanobu Asanuma <[email protected]> (cherry picked from commit db2c320) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestGetBlocks.java hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/balancer/TestBalancerWithHANameNodes.java Co-authored-by: qinyuren <[email protected]>
…3883) Reviewed-by: litao <[email protected]> Signed-off-by: Takanobu Asanuma <[email protected]>
JIRA: HDFS-16423
We have met a problems as described in HDFS-16420
We found that balancer copied a block multi times without deleting the source block if this block was placed in a stale storage. And resulting a block with many copies, but these redundant copies are not deleted until the storage become not stale.
![image](https://user-images.githubusercontent.com/2844826/149301502-cf60927a-fc4b-4089-a856-ced5e90151bc.png)