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

Chris Nauroth commented on HDFS-9038:
-------------------------------------

Thanks for the further reviews.  I'm catching up on patch v005 now.

# The latest {{getNonDfsUsed}} switched to using {{File#getFreeSpace}}.  
However, the {{getAvailable}} calculation uses {{File#getUsableSpace}} via 
{{DF#getAvailable}}.  The non-DFS used calculation prior to the HDFS-5215 patch 
also would have been using {{File#getUsableSpace}}.  I think we should stick 
with {{File#getUsableSpace}} here (or {{DF#getAvailable}} for symmetry with the 
pre-HDFS-5215 code).
# The latest {{getNonDfsUsed}} does not include {{reservedForReplicas}}.  I 
think it should, since the {{reservedForReplicas}} amount is effectively in use 
by HDFS.
# I think we should cap the returned value to 0 as a matter of defensive coding 
against negative values.  There could be a possibility of race conditions in 
between pulling the individual data items, resulting in an unexpected negative 
total.

> Reserved space is erroneously counted towards non-DFS used.
> -----------------------------------------------------------
>
>                 Key: HDFS-9038
>                 URL: https://issues.apache.org/jira/browse/HDFS-9038
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: datanode
>    Affects Versions: 2.7.1
>            Reporter: Chris Nauroth
>            Assignee: Brahma Reddy Battula
>         Attachments: HDFS-9038-002.patch, HDFS-9038-003.patch, 
> HDFS-9038-004.patch, HDFS-9038-005.patch, HDFS-9038.patch
>
>
> HDFS-5215 changed the DataNode volume available space calculation to consider 
> the reserved space held by the {{dfs.datanode.du.reserved}} configuration 
> property.  As a side effect, reserved space is now counted towards non-DFS 
> used.  I don't believe it was intentional to change the definition of non-DFS 
> used.  This issue proposes restoring the prior behavior: do not count 
> reserved space towards non-DFS used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to