hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "maobaolong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDFS-11752) getNonDfsUsed return 0 if reserved bigger than actualNonDfsUsed
Date Thu, 04 May 2017 08:34:04 GMT
maobaolong created HDFS-11752:
---------------------------------

             Summary: getNonDfsUsed return 0 if reserved bigger than actualNonDfsUsed
                 Key: HDFS-11752
                 URL: https://issues.apache.org/jira/browse/HDFS-11752
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: datanode, hdfs
    Affects Versions: 2.7.1
            Reporter: maobaolong
             Fix For: 2.7.1


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

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?



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org


Mime
View raw message