-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HDFS-16182.numOfReplicas is given the wrong value in BlockPlacementPolicyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. #3320
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
Conversation
💔 -1 overall
This message was automatically generated. |
Don't really understand the code but seems like an ancient regression from HDFS-6686. As a general code advice, we should not update a parameter variable and pass it on. |
@jojochuang Agree with you. I think we should fix it. In my cluster, we use BlockPlacementPolicyDefault to choose dn and the number of SSD DN is much less than DISK DN. It may cause to some block that should be placed to SSD DNs fallback to place DISK DNs when SSD DNs are too busy or no enough place. Consider the following scenario.
|
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.
Just a few nits.
...src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
Show resolved
Hide resolved
...op-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
Outdated
Show resolved
Hide resolved
2.declare numOfReplicas a final variable at line 438
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 @Neilxzn for your works. Great catch here! LGTM. +1 once leaved nits comments fixed.
...op-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockStoragePolicy.java
Show resolved
Hide resolved
...src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
I think it is a bug just when fallback storage policy happens. |
💔 -1 overall
This message was automatically generated. |
Failed junit tests seem unrelated. And I try these tests in IDEA locally, these tests run pass.
|
@Neilxzn Please fix checkstyle and check failed unit tests first. Thanks |
💔 -1 overall
This message was automatically generated. |
|
cc @jojochuang . Failed junit tests seem unrelated. Can you review this patch again? 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.
+1
…licyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. (apache#3320)
…licyDefault$chooseTarget can cause DataStreamer to fail with Heterogeneous Storage. (apache#3320) (cherry picked from commit 5626734) Change-Id: Ia57b499cb39eb70272591f8e57b2251da470d83c (cherry picked from commit 7f254f4) Signed-off-by: Arpit Agarwal <aagarwal@cloudera.com>
Description of PR
https://issues.apache.org/jira/browse/HDFS-16182
How was this patch tested?
add TestBlockStoragePolicy.testAddDatanode2ExistingPipelineInSsd
For code changes: