Skip to content

HDDS-16362. GetObjectAttributes ObjectParts should return Part entries for FSO buckets - #11242

Open
Gargi-jais11 wants to merge 2 commits into
apache:masterfrom
Gargi-jais11:HDDS-16362
Open

Gargi-jais11 wants to merge 2 commits into
apache:masterfrom
Gargi-jais11:HDDS-16362

Conversation

@Gargi-jais11

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Extend GetObjectAttributes ObjectParts handling so FSO layout buckets (Ozone’s equivalent of AWS directory buckets) return per-part elements (PartNumber, Size) even when no additional checksum was stored at upload time.

This follows AWS S3 behavior documented in https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributesParts.html:

General-purpose buckets: Part elements are omitted unless an additional checksum (x-amz-checksum-crc32, crc32c, sha1, sha256) was applied.
Directory buckets: Part elements are returned regardless of checksum.

What is the link to the Apache JIRA

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

How was this patch tested?

Added IT and UT.

// FSO bucket getObjectAttributes returns parts info irrespective of checksum present or not

bash-5.1$ aws s3api get-object-attributes --endpoint-url "$ENDPOINT" \
  --bucket "$BUCKET" --key "$KEY" \
  --object-attributes ObjectParts ObjectSize \
  --output json | jq '.ObjectParts | {TotalPartsCount, IsTruncated, PartCount: (.Parts | length), Parts}'
{
  "TotalPartsCount": 2,
  "IsTruncated": false,
  "PartCount": 2,
  "Parts": [
    {
      "PartNumber": 1,
      "Size": 5242880
    },
    {
      "PartNumber": 2,
      "Size": 8
    }
  ]
}
bash-5.1$ aws s3api get-object-attributes --endpoint-url "$ENDPOINT" \
  --bucket "$BUCKET" --key "$KEY" \
  --object-attributes ObjectParts --max-parts 1 --part-number-marker 0 \
  --output json | jq '.ObjectParts | {IsTruncated, Parts}'
{
  "IsTruncated": true,
  "Parts": [
    {
      "PartNumber": 1,
      "Size": 5242880
    }
  ]
}

// OBS bucket doesnot return part info if checksum not present
bash-5.1$ aws s3api get-object-attributes --endpoint-url "$ENDPOINT" \
  --bucket "$BUCKET" --key "$KEY" \
  --object-attributes ObjectParts ObjectSize \
  --output json | jq '.ObjectParts | {TotalPartsCount, IsTruncated, PartCount: (.Parts | length), Parts}'
{
  "TotalPartsCount": 2,
  "IsTruncated": false,
  "PartCount": 0,
  "Parts": null
}

@Gargi-jais11
Gargi-jais11 marked this pull request as ready for review September 15, 2026 08:22
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