Skip to content

Conversation

@tanvipenumudy
Copy link
Contributor

@tanvipenumudy tanvipenumudy commented Nov 8, 2023

What changes were proposed in this pull request?

Currently, we do not support a 'ranged' GET request for a specified part, which is useful for downloading just a part of a multipart key. Even when a part number has been specified, we still download the entire multipart key.

With this fix, we should be able to download just a part of a multipart key. The additional client logic introduced takes advantage of the existing BlockID to partNumber mapping as part of the KeyLocation proto message for filtering out the OmKeyLocationInfo list.

Reference: Amazon S3 GetObject Documentation

Before the fix:

aws s3api get-object --endpoint <endpoint-url>:9879 --bucket bucket --key my_1GB_file --part-number 1 outfile
{
    "AcceptRanges": "bytes",
    "LastModified": "2023-11-06T15:45:34+00:00",
    "ContentLength": 1073741824,
    "CacheControl": "no-cache",
    "ContentType": "application/octet-stream",
    "Expires": "2023-11-09T11:50:30+00:00",
    "Metadata": {}
}

After the fix:

aws s3api get-object --endpoint <endpoint-url>:9879 --bucket bucket --key my_1GB_file --part-number 1 outfile
{
    "AcceptRanges": "bytes",
    "LastModified": "2023-11-06T15:45:34+00:00",
    "ContentLength": 500000000,
    "CacheControl": "no-cache",
    "ContentType": "application/octet-stream",
    "Expires": "2023-11-09T11:46:20+00:00",
    "Metadata": {}
}

What is the link to the Apache JIRA

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

How was this patch tested?

@kerneltime
Copy link
Contributor

@SaketaChalamchala @xBis7 @vtutrinov can you please take a look as well?

@vtutrinov
Copy link
Contributor

LGTM
@tanvipenumudy thank you for adding the feature.

@kerneltime
Copy link
Contributor

Thank you @tanvipenumudy for this change and @vtutrinov for the review. @tanvipenumudy can you please extend the robot test to read a part and validate the size read?

@adoroszlai adoroszlai merged commit 54a5985 into apache:master Nov 17, 2023
@adoroszlai
Copy link
Contributor

Thanks @tanvipenumudy for the patch, @kerneltime, @vtutrinov for the review.

@adoroszlai adoroszlai added the s3 S3 Gateway label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

s3 S3 Gateway

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants