HDFS-17566. Got wrong sorted block order when StorageType is considered. (#6934). Contributed by Chenyu Zheng.

Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
zhengchenyu 2024-07-11 17:41:24 +08:00 committed by GitHub
parent f211af30be
commit 8913d379fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -684,7 +684,7 @@ private Consumer<List<DatanodeInfoWithStorage>> createSecondaryNodeSorter() {
} else if (s2 == null) { } else if (s2 == null) {
return 1; return 1;
} else { } else {
return s2.compareTo(s1); return s1.compareTo(s2);
} }
}); });
secondarySort = list -> Collections.sort(list, comp); secondarySort = list -> Collections.sort(list, comp);