-
Notifications
You must be signed in to change notification settings - Fork 517
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
HDDS-10435. Support S3 object tags for existing requests #6607
Conversation
@vtutrinov @SaketaChalamchala @tanvipenumudy Could you help take a look when you have time? |
} | ||
|
||
if (tagPair.getName().length() > TAG_KEY_LENGTH_LIMIT) { | ||
OS3Exception ex = newError(INVALID_TAG, tagPair.getName()); |
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.
nit: Could you move the tag key and value length checks before the tag regex matching checks?
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.
Thank you for the review. Updated.
Thanks for addressing the comments @ivandika3 . Just one more question, do the robot tests cover both OBJECT_STORE and FILE_SYSTEM_OPTIMIZED buckets? |
@@ -193,6 +204,99 @@ void testPutObjectContentLengthForStreaming() | |||
assertEquals(15, getKeyDataSize()); | |||
} | |||
|
|||
@Test | |||
public void testPutObjectWithTags() throws IOException, OS3Exception { |
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.
Let's split the test case into multiple ones (1 case per error or success way) or make it parameterized
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.
Also, if it's possible, I'd like to check the error messages from the responses of fail-cases
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.
Thank you for the review. Updated.
@@ -438,6 +542,92 @@ public void testCopyObjectMessageDigestResetDuringException() throws IOException | |||
} | |||
} | |||
|
|||
@Test | |||
public void testCopyObjectWithTags() throws IOException, OS3Exception { |
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.
The same notice here
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.
Updated.
${long_tag_value} = Execute printf 'v%.0s' {1..257} | ||
${result} = Execute AWSS3APICli and checkrc put-object --bucket ${BUCKET} --key ${PREFIX}/putobject/custom-metadata/key2 --body /tmp/testfile2 --tagging="tag-key1=${long_tag_value}" 255 | ||
Should contain ${result} InvalidTag | ||
|
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.
nit: might make sense to check the case with a tags list size of more than 10 too
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.
Updated.
@SaketaChalamchala I don't think so. Currently it seems "commonawslib.robot" creates bucket using S3 protocol which should default to OBJECT_STORE. We might need to add FSO support for the S3 compatibility test in the future. I parameterized the integration testing ( |
Thanks for addressing the comments @ivandika3. Raised HDDS-10828. LGTM otherwise. |
I briefly reviewed the code, LGTM. @kerneltime Do you have time to take a look. |
Will take a look today. Thanks |
BTW, @ivandika3 Are you interested in developing User defined object metadata (https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html)? |
Thanks @SaketaChalamchala @guohao-rosicky for the reviews.
It should have been implemented in #3728 and #6489. Please let me know if I miss anything. Tagging is similar to custom metadata, but the use case and constraints are different. |
One requirement is for the client code to move independently of OM version. It is possible that there is a newer S3G client talking to an older OM. In this case how will a new S3G work with an old OM? We can bump up the version between client and OM so that if the client detects an old OM, it will reject the requests with tags. |
Based on the code, the old OM should ignore the tag field. @ivandika3 @kerneltime |
@kerneltime Updated, I created a new @guohao-rosicky is correct that the current behavior is the old OM would just ignore the tag fields. It might be better to ignore than to reject for availability reason, but I'm fine with either approach. |
Thanks @ivandika3 for the patch, @guohao-rosicky, @kerneltime, @SaketaChalamchala, @vtutrinov for the review. |
Thanks @ivandika3 for the patch. |
…concile-cli * HDDS-10239-container-reconciliation: (296 commits) HDDS-10897. Refactor OzoneQuota (apache#6714) HDDS-10422. Fix some warnings about exposing internal representation in hdds-common (apache#6351) HDDS-10899. Refactor Lease callbacks (apache#6715) HDDS-10890. Increase default value for hdds.container.ratis.log.appender.queue.num-elements (apache#6711) HDDS-10832. Client should switch to streaming based on OpenKeySession replication (apache#6683) HDDS-10435. Support S3 object tags for existing requests (apache#6607) HDDS-10883. Improve logging in Recon for finalising DN logic. (apache#6704) HDDS-8752. Enable TestOzoneRpcClientAbstract#testOverWriteKeyWithAndWithOutVersioning (apache#6702) HDDS-10875. XceiverRatisServer#getRaftPeersInPipeline should be called before XceiverRatisServer#removeGroup (apache#6696) HDDS-10514. Recon - Provide DN decommissioning detailed status and info inline with current CLI command output. (apache#6376) HDDS-10878. Bump zstd-jni to 1.5.6-3 (apache#6701) HDDS-10877. Bump Dropwizard metrics to 3.2.6 (apache#6699) HDDS-10876. Bump jackson to 2.16.2 (apache#6697) HDDS-6116. Remove flaky tag from TestSCMInstallSnapshot (apache#6695) HDDS-2643. TestOzoneDelegationTokenSecretManager#testRenewTokenFailureRenewalTime fails intermittently. HDDS-10699. Refactor ContainerBalancerTask and TestContainerBalancerTask (apache#6537) HDDS-10861. Ozone cli supports default ozone.om.service.id (apache#6680) HDDS-10859. Improve error messages when decommission and maintenance fail-early (apache#6678) HDDS-9031. Upgrade acceptance tests to Docker Compose v2 (apache#6667) HDDS-10559. Add a warning or a check to run repair tool as System user (apache#6574) ... Conflicts: hadoop-ozone/dist/src/main/smoketest/admincli/container.robot
What changes were proposed in this pull request?
This patch implements the fundamental changes to support object tags. These includes:
OmKeyInfo
to support object tagsSince this patch already covers fundamental changes, the S3 object tagging APIs (e.g. PutObjectTagging, GetObjectTagging, and DeleteObjectTagging) support will be implemented in the follow up ticket (HDDS-10655).
Note: Currently
OmDirectoryInfo
does not support tags yet. We might need to support this in the future.See: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-tagging.html
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-10435
How was this patch tested?
Unit, integration, and acceptance tests.