-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-7009. Avoid calling getBucket in object APIs #3594
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
kerneltime
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 @DuongNguyen0 for starting the discussion for this change.
hadoop-ozone/interface-client/src/main/proto/OmClientProtocol.proto
Outdated
Show resolved
Hide resolved
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.
This call is present in other places as well (e.g get, put, delete, abort etc). Is it possible to fix there as well?
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.
Yup, it's definitely what we want. I'd like to take that review to confirm the approach then we can apply that for other S3 APIs.
|
@kerneltime I've changed this PR scope to only avoid the |
adoroszlai
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 @DuongNguyen0 for refining the patch. Can ObjectEndpoint use ClientProtocol/RpcClient directly, instead of having to pollute OzoneVolume with key-related operations?
Yes, it can be done that way. I decided to follow the precedence to easily stub the |
Updated to use ClientProtocol directly instead of putting delegation in |
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java
Outdated
Show resolved
Hide resolved
...p-ozone/s3gateway/src/test/java/org/apache/hadoop/ozone/s3/endpoint/TestPermissionCheck.java
Show resolved
Hide resolved
In some sense, volume is a composition of buckets and keys, so having this as part of volume might not be that bad. |
|
Co-authored-by: Ritesh H Shukla <[email protected]>
…nt/rpc/RpcClient.java Co-authored-by: Ritesh H Shukla <[email protected]>
Co-authored-by: Ritesh H Shukla <[email protected]>
|
@smengcl can you have a look? |
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/OzoneClient.java
Show resolved
Hide resolved
smengcl
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 @DuongNguyen0 for the patch. Overall lgtm. Some minor comments inline.
IIUC, the idea is similar to what we've done in OFS -- use ClientProtocol directly wherever possible in order to get rid of the extra round trip that gets the bucket before getting the key.
New acceptance test cases (objecthead.robot) are triggered and passing: https://github.com/apache/ozone/runs/7416388703
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java
Show resolved
Hide resolved
Co-authored-by: Siyao Meng <[email protected]>
Co-authored-by: Siyao Meng <[email protected]>
Co-authored-by: Siyao Meng <[email protected]>
smengcl
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.
+1 pending CI. Some kubernetes (seemingly unrelated) tests were failing.
What changes were proposed in this pull request?
Today, a keyLookup (head-object) in S3G makes 3 calls to OM (ref: ObjectEndpoint, EndpointBase and ObjectStore).
getS3VolumeContext: to get the S3 volume name under the tenant (callee) context.getBucket: for no particular reason, maybe it's only for code convenience.headObject(volume, bucket, key): actual key lookup.The same pattern happens for all APIs in ObjectEndpoint.
This code change removes the
getBucketcall where possible to improve S3 throughput and avoid storming OM unnecessarily.What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-7009
How was this patch tested?
Unit test, robot test.