You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "rich7420 (via GitHub)" <gi...@apache.org> on 2026/09/30 15:01:38 UTC

[PR] HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration [ozone]

rich7420 opened a new pull request, #11374:
URL: https://github.com/apache/ozone/pull/11374

   ## What changes were proposed in this pull request?
   
   Reuse the `OzoneBucket` fetched during expected bucket owner verification in `PutBucketLifecycleConfiguration`. Requests that pass verification currently fetch the same bucket again before constructing and setting the lifecycle configuration. Reusing it removes one `InfoBucket` RPC while retaining the existing bucket READ requirement, owner validation, bucket layout handling, and error handling. Requests without a non-empty expected-owner header still perform the existing lookup.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16649
   
   ## How was this patch tested?
   
   - https://github.com/rich7420/ozone/actions/runs/36680261563/attempts/4
   - [10×10 flaky-test-check passed](https://github.com/rich7420/ozone/actions/runs/36680345705) for `TestS3LifecycleConfigurationPut` on Java 21.
   


-- 
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


Re: [PR] HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration [ozone]

Posted by "adoroszlai (via GitHub)" <gi...@apache.org>.
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


Re: [PR] HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 closed pull request #11374: HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration
URL: https://github.com/apache/ozone/pull/11374


-- 
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


Re: [PR] HDDS-16649. Reuse bucket metadata after owner verification in S3 PutBucketLifecycleConfiguration [ozone]

Posted by "rich7420 (via GitHub)" <gi...@apache.org>.
rich7420 commented on PR #11374:
URL: https://github.com/apache/ozone/pull/11374#issuecomment-5928316168

   Combined into #11372, which now covers both HDDS-16649 and HDDS-16650 using the request-context bucket cache suggested in review.
   


-- 
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