You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Weiwei Yang (Jira)" <ji...@apache.org> on 2020/03/03 04:58:00 UTC

[jira] [Commented] (HADOOP-16840) AliyunOSS: getFileStatus throws FileNotFoundException in versioning bucket

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

Weiwei Yang commented on HADOOP-16840:
--------------------------------------

Hi [~wujinhu]

Sorry for the late response... I was quite busy with some other work.

For the patch here, I don't know the internal things for OSS. But the code you added might be running to endless loop... I think at least you need a timeout to break the loop. What do you think?

> AliyunOSS: getFileStatus throws FileNotFoundException in versioning bucket
> --------------------------------------------------------------------------
>
>                 Key: HADOOP-16840
>                 URL: https://issues.apache.org/jira/browse/HADOOP-16840
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/oss
>    Affects Versions: 2.10.0, 2.9.2, 3.0.3, 3.2.1, 3.1.3
>            Reporter: wujinhu
>            Assignee: wujinhu
>            Priority: Major
>         Attachments: HADOOP-16840.001.patch, HADOOP-16840.002.patch
>
>
> When hadoop lists object in versioning bucket with many delete marker in it, OSS will return
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <ListBucketResult>
>   <Name>select-us-east-1</Name>
>   <Prefix>test/hadoop/file/</Prefix>
>   <Marker></Marker>
>   <MaxKeys>100</MaxKeys>
>   <Delimiter>/</Delimiter>
>   <IsTruncated>true</IsTruncated>
>   <NextMarker>test/hadoop/file/sub2</NextMarker>
> </ListBucketResult>
> {code}
> It sets *IsTruncated* to true and without *ObjectSummaries* or *CommonPrefixes*, and will throw FileNotFoundException
> {code:java}
> // code placeholder
> java.io.FileNotFoundException: oss://select-us-east-1/test/hadoop/file: No such file or directory!java.io.FileNotFoundException: oss://select-us-east-1/test/hadoop/file: No such file or directory!
>  at org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem.getFileStatus(AliyunOSSFileSystem.java:281) at org.apache.hadoop.fs.aliyun.oss.TestAliyunOSSFileSystemContract.testGetFileStatusInVersioningBucket{code}
>  
> {code:java}
> // code placeholder
> ObjectListing listing = store.listObjects(key, 1, null, false);
> if (CollectionUtils.isNotEmpty(listing.getObjectSummaries()) ||
>     CollectionUtils.isNotEmpty(listing.getCommonPrefixes())) {
>   return new OSSFileStatus(0, true, 1, 0, 0, qualifiedPath, username);
> } else {
>   throw new FileNotFoundException(path + ": No such file or directory!");
> }
> {code}
>  In this case, we should call listObjects until *IsTruncated* is false or *ObjectSummaries* is not empty or *CommonPrefixes* is not empty.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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