Skip to content

HDDS-15739. Fix ListObjectsV2 continuation-token: wrong XML element name and empty-token handling#10668

Merged
smengcl merged 1 commit into
apache:masterfrom
rich7420:HDDS-listv2-continuation-token
Jul 10, 2026
Merged

HDDS-15739. Fix ListObjectsV2 continuation-token: wrong XML element name and empty-token handling#10668
smengcl merged 1 commit into
apache:masterfrom
rich7420:HDDS-listv2-continuation-token

Conversation

@rich7420

@rich7420 rich7420 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

ListObjectsV2 has two server-side bugs around the continuation token that make S3 SDK clients fail:

  1. Wrong response element name. The echoed request continuation token was serialized as
    <continueToken> instead of AWS's <ContinuationToken>. botocore maps response fields by
    element name, so response['ContinuationToken'] was never populated and clients that read it
    back hit a KeyError.
  2. Empty token not treated as "no token". An empty ContinuationToken='' was passed
    (non-null) into ContinueToken.decodeFromString(), which found no separator and threw
    InvalidArgument. AWS treats an empty continuation token as no token — return all keys,
    IsTruncated=false, and echo '' back.

To align with AWS S3:

  • Serialize the response continuation token as ContinuationToken (ListObjectResponse
    @XmlElement).
  • In BucketEndpoint, treat a null/empty continuation-token query param as absent (list from
    the start, keyed off the decoded token) while still echoing the request value back.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15739

How was this patch tested?

https://github.com/rich7420/ozone/actions/runs/28727345055

…ame and empty-token handling

Serialize the echoed request continuation token as <ContinuationToken>
(previously <continueToken>) so S3 SDK clients populate
response['ContinuationToken'] instead of hitting a KeyError.

Treat an empty continuation-token as no token: list from the start with
IsTruncated=false and echo the empty token back, instead of throwing
InvalidArgument when decoding it.

Fixes ceph s3-tests test_bucket_listv2_continuationtoken,
test_bucket_listv2_continuationtoken_empty and
test_bucket_listv2_both_continuationtoken_startafter.

@Russole Russole left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @rich7420 for the patch. LGTM!

@smengcl smengcl merged commit 1d6a5f4 into apache:master Jul 10, 2026
45 checks passed
@smengcl

smengcl commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Thanks @rich7420 for the patch. Thanks @Russole for reviewing this.

@rich7420

Copy link
Copy Markdown
Contributor Author

@Russole and @smengcl thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants