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

getNonDfsUsed return 0 if reserved bigger than actualNonDfsUsed

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.7.1
    • Component/s: datanode, hdfs
    • Labels:

      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

            • Assignee:
              Unassigned
              Reporter:
              maobaolong maobaolong
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: