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 "Hexiaoqiao (via GitHub)" <gi...@apache.org> on 2023/09/19 14:01:22 UTC
[GitHub] [hadoop] Hexiaoqiao commented on a diff in pull request #6035: HDFS-17098. DatanodeManager does not handle null storage type properly
Hexiaoqiao commented on code in PR #6035:
URL: https://github.com/apache/hadoop/pull/6035#discussion_r1330184496
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java:
##########
@@ -666,7 +666,15 @@ private Consumer<List<DatanodeInfoWithStorage>> createSecondaryNodeSorter() {
Consumer<List<DatanodeInfoWithStorage>> secondarySort = null;
if (readConsiderStorageType) {
Comparator<DatanodeInfoWithStorage> comp =
- Comparator.comparing(DatanodeInfoWithStorage::getStorageType);
+ Comparator.comparing(DatanodeInfoWithStorage::getStorageType, (s1, s2) -> {
+ if (s1 == null) {
Review Comment:
Thanks @teamconfx for your report and fix. But I am confused why the StorageType will be null here. IIUC, this attribute will be set when report from DataNode once, and it's value will set to DISK by default. So any corner case here?
--
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