You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "adoroszlai (via GitHub)" <gi...@apache.org> on 2026/10/01 07:49:44 UTC
Re: [PR] HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration [ozone]
adoroszlai commented on code in PR #11374:
URL: https://github.com/apache/ozone/pull/11374#discussion_r4153044862
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketLifecycleHandler.java:
##########
@@ -128,9 +130,11 @@ private void verifyBucketOwner(S3RequestContext context, String bucketName) thro
public Response putBucketLifecycleConfiguration(S3RequestContext context, String bucketName, InputStream body)
throws IOException, OS3Exception {
- verifyBucketOwner(context, bucketName);
+ OzoneBucket ozoneBucket = verifyBucketOwner(context, bucketName);
S3LifecycleConfiguration s3LifecycleConfiguration;
- OzoneBucket ozoneBucket = context.getVolume().getBucket(bucketName);
+ if (ozoneBucket == null) {
+ ozoneBucket = context.getVolume().getBucket(bucketName);
+ }
Review Comment:
Instead of changing `verifyBucketOwner` to return the bucket and handling `null` case here, I would like to suggest a different approach:
- add `OzoneBucket getBucket(String bucketName)` in `S3RequestContext`, storing the bucket, similar to `getVolume()`; I think each request applies to only one bucket, so it can reject subsequent `getBucket(differentName)` calls for now
- use `context.getBucket(bucketName)` in both `verifyBucketOwner` and here
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org