-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-15386. ReplicaNotFoundException keeps happening in DN after removing multiple DN's data directories. #2052
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. |
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.
If you like, you can change this block to below (Java 8 feature):
List<ReplicaInfo> blocks = blkToInvalidate.computeIfAbsent(bpid, (k) -> new ArrayList<>());
This will return the existing key if it exists, or create a new one it does not.
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 thinking - this fix will need to go on all branches back into the 2.8 branch, which I think still uses Java 7. Therefore it would be ideal to have the computeIfAbsent method for trunk and 3.x but we will need a patch like this existing one for branch 2.
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.
@sodonnel Thank you for reviewing this!
Okay, I will change the code for your review here. And after this is committed to trunk, I will make a new PR for branch 2, which is like the original code.
|
💔 -1 overall
This message was automatically generated. |
…ing multiple DN's data directories
|
💔 -1 overall
This message was automatically generated. |
|
These changes LGTM +1 |
…ving multiple DN's data directories (apache#2052) Contributed by Toshihiro Suzuki. Ref: ENGESC-2568 (cherry picked from commit 545a0a1) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java Change-Id: I3a3dd2a01066bcbffb3d4011768e9102a1ed7961 (cherry picked from commit 29ede28)
…ing multiple DN's data directories