[ 
https://issues.apache.org/jira/browse/HDFS-17197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17766275#comment-17766275
 ] 

ASF GitHub Bot commented on HDFS-17197:
---------------------------------------

zhangshuyan0 commented on code in PR #6095:
URL: https://github.com/apache/hadoop/pull/6095#discussion_r1328403016


##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -6195,7 +6197,11 @@ Collection<CorruptFileBlockInfo> 
listCorruptFileBlocks(String path,
         if (inode != null) {
           String src = inode.getFullPathName();
           if (isParentEntry(src, path)) {
-            corruptFiles.add(new CorruptFileBlockInfo(src, blk));
+            int repl = 0;
+            if (inode.isFile()) {
+              repl = inode.asFile().getFileReplication();

Review Comment:
   Oh, I forgot to take this situation into account. How about printing -1 in 
`CorruptFileBlockInfo` when this is a EC file?





> Show file replication when listing corrupt files.
> -------------------------------------------------
>
>                 Key: HDFS-17197
>                 URL: https://issues.apache.org/jira/browse/HDFS-17197
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>            Reporter: Shuyan Zhang
>            Priority: Major
>              Labels: pull-request-available
>
> Files with different replication have different reliability guarantees. We 
> need to pay attention to corrupted files with a specified replication greater 
> than or equal to 3. So, when listing corrupt files, it would be useful to 
> display the corresponding replication of the files.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to