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

getNonDfsUsed return 0 if reserved bigger than actualNonDfsUsed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.7.1
    • 2.7.1
    • datanode, hdfs

    Description

      public long getNonDfsUsed() throws IOException {
          long actualNonDfsUsed = getActualNonDfsUsed();
          if (actualNonDfsUsed < reserved) {
            return 0L;
          }
          return actualNonDfsUsed - reserved;
        }
      

      The code block above is the function to caculate nonDfsUsed, but in fact it will let the result to be 0L out of expect. Such as this following situation:

      du.reserved = 50G
      Disk Capacity = 2048G
      Disk Available = 2000G
      Dfs used = 30G

      usage.getUsed() = dirFile.getTotalSpace() - dirFile.getFreeSpace()
      = 2048G - 2000G
      = 48G
      getActualNonDfsUsed = usage.getUsed() - getDfsUsed()
      = 48G - 30G
      = 18G
      18G < 50G, so the function `getNonDfsUsed` actualNonDfsUsed < reserved, and the NonDfsUsed will return 0, is that logic make sense?

      Attachments

        Activity

          People

            Unassigned Unassigned
            maobaolong Baolong Mao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: