[
https://issues.apache.org/jira/browse/HDFS-5215?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13820096#comment-13820096
]
Brahma Reddy Battula commented on HDFS-5215:
--------------------------------------------
{quote}
The remaining space returned is smaller of the above two. This seems correct to
me. What is the need to remove reserved space from available above?
{quote}
AS we are assigning the available to remaining,there is one case where always
remaining will be greater than available space.. this scenario will come where
dfsused is very less but disk got filled with non-dfs data..
{code}
if (remaining > available) {
remaining = available;
}
{code}
Check following for same..
TEST ENV: total space of datanode disk is 69G, revered space 10G, available
space is 66G at beginning, dd command generate files use 52G space.
Debug the old code:
long remaining = getCapacity()-getDfsUsed(); -- 63242600448
long available = usage.getAvailable(); -- 14144172032
if (remaining > available) {
remaining = available; -- 14144172032
}
Upload 6 files, as per file has 666266906 bytes:
long remaining = getCapacity()-getDfsUsed(); -- 59213767320
long available = usage.getAvailable(); -- 10110709760
if (remaining > available) {
remaining = available; -- 10110709760
}
Upload 7th file success.
Clear the env and degug the new code:
long remaining = getCapacity()-getDfsUsed(); -- 63238742828
long available = usage.getAvailable()- reserved; -- 3406753792
if (remaining > available) {
remaining = available; -- 3406753792
}
Upload 6 files, as per file has 666266906 bytes:
long remaining = getCapacity()-getDfsUsed(); -- 59881381888
long available = usage.getAvailable()- reserved; -- 45535232
if (remaining > available) {
remaining = available; -- 45535232
}
Upload 7th file failed.
> dfs.datanode.du.reserved is not taking effect as it's not considered while
> getting the available space
> ------------------------------------------------------------------------------------------------------
>
> Key: HDFS-5215
> URL: https://issues.apache.org/jira/browse/HDFS-5215
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: datanode
> Affects Versions: 3.0.0
> Reporter: Brahma Reddy Battula
> Assignee: Brahma Reddy Battula
> Fix For: 3.0.0
>
> Attachments: HDFS-5215.patch
>
>
> {code}public long getAvailable() throws IOException {
> long remaining = getCapacity()-getDfsUsed();
> long available = usage.getAvailable();
> if (remaining > available) {
> remaining = available;
> }
> return (remaining > 0) ? remaining : 0;
> }
> {code}
> Here we are not considering the reserved space while getting the Available
> Space.
--
This message was sent by Atlassian JIRA
(v6.1#6144)