[ 
https://issues.apache.org/jira/browse/HADOOP-16840?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Akira Ajisaka updated HADOOP-16840:
-----------------------------------
    Fix Version/s:     (was: 2.11.0)

> 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
>             Fix For: 3.0.4, 3.3.0, 2.9.3, 3.1.4, 3.2.2, 2.10.1
>
>         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-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to