-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-10395. Fix eTag compatibility issues during MPU #6235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I encountered another compatibility issue during upload-part from the new S3G and old OM. Will add the patch after I tested it. |
Do you plan to add it to this PR? |
|
@kerneltime Yes, currently testing it. |
|
@kerneltime I have tested the compatibility fixes manually and the result looks good. I also updated the PR title and the description with more information. PTAL. Thank you. |
myskov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch @ivandika3.
|
Note: I also noticed that the |
|
@kerneltime would you like to take another look? |
|
Thanks @ivandika3 for the patch, @kerneltime, @myskov for the review. |
|
Thank you for the reviews @kerneltime @myskov, and @adoroszlai for the merge. |
(cherry picked from commit 5f6306d)
What changes were proposed in this pull request?
Found an eTag incompatibility in S3 listParts while testing the multipart uploads an old S3G and a new OM.
Case 1: Old S3G and new OM
This will throw "java.util.NoSuchElementException: No value present" in case where the MPU part does not contain eTag field (before HDDS-9680)
ObjectEndpoint#listParts is currently only returning the MPU part eTag, which might not exist for old MPU parts. This can be resolved by falling back to using partName as eTag if the eTag is not specified.
NPE when calling setETag with null (in OmPartInfo#getProto). This can be resolved by doing a simple nullity check.
Case 2: New S3G and old OM
InvalidPartduring MPU complete. This can be resolved by falling back to use part name as eTag response, ifOmMultipartCommitUploadPartInfoeTag field is empty / null.Ongoing multipart uploads when OM is updated from the old OM to the new OM
There might be multipart uploads that are ongoing during the OM upgrades from the old OM (without md5 hash eTag) and new OM (with md5 hash eTag)
In the new OM, the eTag is calculated during the MPU complete using this method
md5(<concatenated-part's-etag-or-partname>-<number of parts>), seeS3MultipartUploadCompleteRequest#multipartUploadedKeyHash.For example, for MPU done entirely on the new OM the eTag of the parts and the final key will be:
Part 1 ETAG (new): 6b3f1d2b18292bbb32585cf0ff31b36c
Part 2 ETAG (new): 6b3f1d2b18292bbb32585cf0ff31b36c
Part 3 ETAG (new): 6b3f1d2b18292bbb32585cf0ff31b36c
ETAG of MPU:
md5(6b3f1d2b18292bbb32585cf0ff31b36c6b3f1d2b18292bbb32585cf0ff31b36c6b3f1d2b18292bbb32585cf0ff31b36c-3)However, if some of the parts is uploaded before the new OM, it will fall back using the MPU part name instead. Hence the calculation will be
Part 1 ETAG (old): /s3v/etag-test-bucket/mpu-key-046d6d5b-eec1-41c2-bc97-6df8ebe12487-111968005487722496-1
Part 2 ETAG (old): /s3v/etag-test-bucket/mpu-key-046d6d5b-eec1-41c2-bc97-6df8ebe12487-111968005487722496-2
Part 3 ETAG (new): 6b3f1d2b18292bbb32585cf0ff31b36c
ETAG of MPU:
md5(/s3v/etag-test-bucket/mpu-key-046d6d5b-eec1-41c2-bc97-6df8ebe12487-111968005487722496-1/s3v/etag-test-bucket/mpu-key-046d6d5b-eec1-41c2-bc97-6df8ebe12487-111968005487722496-26b3f1d2b18292bbb32585cf0ff31b36c-3).There is a minor compatibility limitation, where another multipart upload with the same exact parts are uploaded again, the eTag will not be the same as the multipart upload uploaded during the OM upgrade. However, I think this should not have a major impact.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10395
How was this patch tested?
Unit test and manual test between OM and S3G of different versions.
Clean CI run: https://github.com/ivandika3/ozone/actions/runs/7972393497
For reference, the issue replicated with the following MPU script which manually call the s3 API for MPU. It should also be able to be replicated with "aws s3 cp" for large files since it will use multipart uploads, and most probably will call the listParts API.