Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14340

Lower the log level when can't get postOpAttr

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0, 3.2.1, 3.1.3
    • nfs
    • Reviewed

    Description

      I think should lower the log level when can't get postOpAttr in hadoop-2.8.5-src/hadoop-hdfs-project/hadoop-hdfs-nfs/src/main/java/org/apache/hadoop/hdfs/nfs/nfs3/RpcProgramNfs3.java

       

      **************The fisrt code snippet***************
      //the problematic log level ERROR, at line 1044
      try {
         dirWcc = Nfs3Utils.createWccData(Nfs3Utils.getWccAttr(preOpDirAttr),
         dfsClient, dirFileIdPath, iug);
      } catch (IOException e1) {
         LOG.error("Can't get postOpDirAttr for dirFileId: "
         + dirHandle.getFileId(), e1);
      }
      **************The second code snippet***************
      //other practice in similar code snippets, line number is 475, the log assigned with INFO level
      try { 
         wccData = Nfs3Utils.createWccData(Nfs3Utils.getWccAttr(preOpAttr), dfsClient,   fileIdPath, iug); 
      } catch (IOException e1) { 
         LOG.info("Can't get postOpAttr for fileIdPath: " + fileIdPath, e1); 
      }
      **************The third code snippet***************
      //other practice in similar code snippets, line number is 1405, the log assigned with INFO level
      try {
         fromDirWcc = Nfs3Utils.createWccData(
         Nfs3Utils.getWccAttr(fromPreOpAttr), dfsClient, fromDirFileIdPath,iug);
         toDirWcc = Nfs3Utils.createWccData(Nfs3Utils.getWccAttr(toPreOpAttr),
         dfsClient, toDirFileIdPath, iug);
      } catch (IOException e1) {
         LOG.info("Can't get postOpDirAttr for " + fromDirFileIdPath + " or"
         + toDirFileIdPath, e1);
      }
      
      
      

      Therefore, I think the logging practices should be consistent in similar contexts. When the code catches IOException for getWccAttr() method, it more likely prints a log message with INFO level, a lower level.

       

      Attachments

        1. HDFS-14340.trunk.patch
          0.9 kB
          Anuhan Torgonshar

        Activity

          People

            OneisAll Anuhan Torgonshar
            OneisAll Anuhan Torgonshar
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: