Kohei Sugihara created HDDS-7713:
------------------------------------
Summary: listKeys in S3G serves a prefix path as a key too but it
is redundant
Key: HDDS-7713
URL: https://issues.apache.org/jira/browse/HDDS-7713
Project: Apache Ozone
Issue Type: Bug
Components: S3
Affects Versions: 1.3.0
Environment: Version: Our forked version based ozone-1.3.0 branch.
commit hash is
https://github.com/apache/ozone/commit/9c61a8aa497ab96c014ad3bb7b1ee4f731ebfaf8
FSO-enabled bucket
Reporter: Kohei Sugihara
The listKeys API in S3G returns a prefix for the requested path as a key. But
it is not S3-compatible behavior and I think this is not necessary. I'm sharing
some simple examples.
h2. Case #1: listKeys for a specific prefix (aws s3 ls s3://bucket/path/) has
an unnecessary entry
Result
{quote} PRE .git/
PRE autom4te.cache/
PRE config/
PRE contrib/
PRE doc/
PRE src/
PRE testing/
*2022-10-20 15:51:38 0*
2022-10-20 15:51:40 635 .gitignore
2022-10-20 15:51:40 1470 .travis.yml
2022-10-20 15:51:40 0 AUTHORS
2022-10-20 15:51:40 14585 COPYRIGHT
2022-10-20 15:51:40 43 META
2022-10-20 15:51:40 25602 Makefile
2022-10-20 15:51:40 506 Makefile.am
2022-10-20 15:51:40 25554 Makefile.in
2022-10-20 15:51:40 12274 NEWS
2022-10-20 15:51:40 1215 README.md
2022-10-20 15:51:40 44649 aclocal.m4
2022-10-20 15:51:40 27 bootstrap
2022-10-20 15:51:40 62978 config.log
2022-10-20 15:51:40 36114 config.status
2022-10-20 15:51:40 248813 configure
2022-10-20 15:51:41 16382 configure.ac
2022-10-20 15:51:43 659 travis-build.sh
2022-10-20 15:51:43 1406 travis-test.sh{quote}
XML
{quote}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>bucket</Name>
<Prefix>path/</Prefix>
<Marker></Marker>
<MaxKeys>1000</MaxKeys>
<KeyCount>28</KeyCount>
<Delimiter>/</Delimiter>
<EncodingType>url</EncodingType>
<IsTruncated>false</IsTruncated>
*<Contents> <!-- S3G serves the prefix as a key that we're requested -->*
*<Key>path/</Key>*
*<LastModified>2022-10-20T06:51:38.409Z</LastModified>*
*<ETag>2022-10-20T06:51:38.409Z</ETag>*
*<Size>0</Size>*
*<StorageClass>STANDARD</StorageClass>*
*</Contents>*
<Contents>
<Key>path/.gitignore</Key>
<LastModified>2022-10-20T06:51:40.575Z</LastModified>
<ETag>2022-10-20T06:51:40.575Z</ETag>
<Size>635</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
<!-- snip -->
<Contents>
<Key>path/travis-test.sh</Key>
<LastModified>2022-10-20T06:51:43.080Z</LastModified>
<ETag>2022-10-20T06:51:43.080Z</ETag>
<Size>1406</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
<CommonPrefixes>
<Prefix>path/.git/</Prefix>
</CommonPrefixes>
<!-- snip -->
<CommonPrefixes>
<Prefix>path/testing/</Prefix>
</CommonPrefixes>
</ListBucketResult>{quote}
h2. Case #2: listKey for a specific key (aws s3 ls s3://bucket/path/Makefile)
has two redundant entries
Result
{quote}2022-10-20 15:51:40 25602 Makefile
2022-10-20 15:51:40 25602 Makefile
{quote}
XML
{quote}<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>bucket</Name>
<Prefix>path/Makefile</Prefix>
<Marker></Marker>
<MaxKeys>1000</MaxKeys>
<KeyCount>2</KeyCount>
<Delimiter>/</Delimiter>
<EncodingType>url</EncodingType>
<IsTruncated>false</IsTruncated>
*<Contents> <!-- S3G serves a path that we're requested but this line is
redundant -->*
*<Key>path/Makefile</Key>*
*<LastModified>2022-10-20T06:51:40.590Z</LastModified>*
*<ETag>2022-10-20T06:51:40.590Z</ETag>*
*<Size>25602</Size>*
*<StorageClass>STANDARD</StorageClass>*
*</Contents>*
<Contents>
<Key>path/Makefile</Key>
<LastModified>2022-10-20T06:51:40.590Z</LastModified>
<ETag>2022-10-20T06:51:40.590Z</ETag>
<Size>25602</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>{quote}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]