ferhui commented on a change in pull request #3065: URL: https://github.com/apache/hadoop/pull/3065#discussion_r647357273
########## File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java ########## @@ -1996,7 +1996,12 @@ private void metaSave(PrintWriter out) { LightWeightHashSet<Long> openFileIds = new LightWeightHashSet<>(); for (DatanodeDescriptor dataNode : blockManager.getDatanodeManager().getDatanodes()) { - for (long ucFileId : dataNode.getLeavingServiceStatus().getOpenFiles()) { + // Sort open files + LightWeightHashSet<Long> dnOpenFiles = + dataNode.getLeavingServiceStatus().getOpenFiles(); + Long[] dnOpenFileIds = new Long[dnOpenFiles.size()]; + Arrays.sort(dnOpenFiles.toArray(dnOpenFileIds)); + for (Long ucFileId : dnOpenFileIds) { Review comment: @aajisaka Thank you very much for review, add this change because TestDecommission#testDecommissionWithOpenfileReporting fails. In DatanodeAdminDefaultMonitor#processBlocksInternal, blocks are sorted because of FoldedTreeSet, so here inode ids are sorted. -- 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. 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