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

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

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


##########
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:
   What will be return if this inode is one EC file here?



##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java:
##########
@@ -6131,15 +6131,17 @@ void releaseBackupNode(NamenodeRegistration 
registration)
   static class CorruptFileBlockInfo {
     final String path;
     final Block block;
+    private final int replication;
     
-    public CorruptFileBlockInfo(String p, Block b) {
+    CorruptFileBlockInfo(String p, Block b, int r) {
       path = p;
       block = b;
+      replication = r;
     }
     
     @Override
     public String toString() {
-      return block.getBlockName() + "\t" + path;
+      return block.getBlockName() + "\t" + replication + "\t" + path;

Review Comment:
   I am a little worried about the compatibility while upstream dependency with 
this string but we change the format here.





> 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