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/09 05:10:00 UTC
[jira] [Comment Edited] (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=17054673#comment-17054673 ]
Weiwei Yang edited comment on HADOOP-16840 at 3/9/20, 5:09 AM:
---------------------------------------------------------------
Committed to trunk, branch-3.2, branch-3.1, branch-2.10, branch-2.9, thanks [~wujinhu] for the contribution.
was (Author: wwei):
Committed to trunk, branch-3.2, branch-3.1, branch-2.10, branch-2.9
> 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.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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org