Skip to content

Unnecessary NextMarker in Get Bucket's response if CommonPrefixes contain the last key. [JIRA: RCS-155] #1099

@ksauzz

Description

@ksauzz

This is mostly harmless API incompatible issue.

In 'Get Bucket' request using delimiter, Riak CS should not respond unnecessary NextMarker if common prefixes contains the last key.

This bug is found by one of ceph_tests. After the fix, this test can be enabled.

reproduction

make following 5 objects:

% s3cmd -c user.cfg ls -r s3://test/
2015-03-19 09:06         0   s3://test/asdf
2015-03-19 09:06         0   s3://test/boo/bar
2015-03-19 09:07         0   s3://test/boo/baz/xyzzy
2015-03-19 09:07         0   s3://test/cquux/bla
2015-03-19 09:07         0   s3://test/cquux/thud

get 2nd page with max-keys=1 as a following:

on Riak CS

% s3curl.pl --id user -- -x localhost:8080 "http://test.s3.amazonaws.com/?delimiter=/&marker=boo/&max-keys=1" -s | tidy -xml -indent -q
<?xml version="1.0" encoding="utf-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>test</Name>
  <Prefix></Prefix>
  <Marker>boo/</Marker>
  <NextMarker>cquux/</NextMarker>            <---------- unnecessary
  <MaxKeys>1</MaxKeys>
  <Delimiter>/</Delimiter>
  <IsTruncated>false</IsTruncated>
  <CommonPrefixes>
    <Prefix>cquux/</Prefix>
  </CommonPrefixes>
</ListBucketResult>

on AWS

% s3curl.pl --id aws -- "http://xxxxxxxxxx.s3.amazonaws.com/?delimiter=/&marker=boo/&max-keys=1" -s | tidy -xml -indent -q
<?xml version="1.0" encoding="utf-8"?>
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
  <Name>xxxxxxxxxx</Name>
  <Prefix></Prefix>
  <Marker>boo/</Marker>
  <MaxKeys>1</MaxKeys>
  <Delimiter>/</Delimiter>
  <IsTruncated>false</IsTruncated>
  <CommonPrefixes>
    <Prefix>cquux/</Prefix>
  </CommonPrefixes>
</ListBucketResult>

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions