Skip to content

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

Open
rich7420 wants to merge 1 commit into
apache:masterfrom
rich7420:HDDS-listv2-continuation-token
Open

HDDS-15739. Fix ListObjectsV2 continuation-token: wrong XML element name and empty-token handling#10668
rich7420 wants to merge 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.
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.

1 participant