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-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org