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

Hualong Zhang commented on HDFS-17014:
--------------------------------------

[~ayushtkn] Thank you for your reminder! I

After careful examination, we have discovered that this segment of logic in 
{*}BaseTestHttpFSWith{*}#{*}testGetStatus{*} may potentially cause the issue.
{noformat}
FsStatus dfsFsStatus = dfs.getStatus(path);
FsStatus httpFsStatus = httpFs.getStatus(path);

// Validate used free and capacity are the same as DistributedFileSystem
assertEquals(dfsFsStatus.getUsed(), httpFsStatus.getUsed());
assertEquals(dfsFsStatus.getRemaining(), httpFsStatus.getRemaining());
assertEquals(dfsFsStatus.getCapacity(), httpFsStatus.getCapacity());
{noformat}
The reasons are as follows:

1.The *getStatus* API used to retrieve the used/remaining space of the 
FileSystem may pose a problem. In {*}TestHttpFSWithHttpFSFileSystem{*}, all 
*unit tests* share a single FileSystem and are executed in parallel, with file 
writes or deletions occurring randomly. As a result, the usage size of the file 
system may change at any time, causing the used/remaining values returned by 
*httpFs.getStatus* to potentially differ from those returned by 
{*}dfs.getStatus{*}, thereby resulting in test failures.

2.When conducting *unit tests* in {*}TestWebHDFS{*}, we utilized a separate 
*MiniDFSCluster* to avoid encountering this issue.

We have the option of modifying the *unit tests* to only validate whether 
used/remaining/capacity >= 0, or alternatively, using a new MiniDFSCluster in 
this particular test to ensure that any writes or deletions performed by other 
unit tests do not impact our test results.

> HttpFS Add Support getStatus API
> --------------------------------
>
>                 Key: HDFS-17014
>                 URL: https://issues.apache.org/jira/browse/HDFS-17014
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: webhdfs
>    Affects Versions: 3.4.0
>            Reporter: Hualong Zhang
>            Assignee: Hualong Zhang
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.4.0
>
>
> We should ensure that *WebHDFS* remains synchronized with {*}HttpFS{*}, as 
> the former has already implemented the *getStatus* interface.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to