priyeshkaratha commented on code in PR #11003:
URL: https://github.com/apache/ozone/pull/11003#discussion_r3772736083


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/BucketLifecycleHandler.java:
##########
@@ -140,6 +140,13 @@ public Response 
putBucketLifecycleConfiguration(S3RequestContext context, String
     } catch (WebApplicationException ex) {
       throw S3ErrorTable.newError(S3ErrorTable.MALFORMED_XML, bucketName);
     } catch (OMException ex) {
+      // OM reports lifecycle validation failures as INVALID_REQUEST, which 
the shared translation maps to
+      // InvalidRequest. AWS S3 uses InvalidArgument for rejected lifecycle 
configurations, so remap
+      // INVALID_REQUEST -> InvalidArgument for this endpoint. This also 
applies to OM-only checks
+      // (e.g. bucket layout mismatch), even though there is no AWS equivalent.
+      if (ex.getResult() == OMException.ResultCodes.INVALID_REQUEST) {

Review Comment:
   The bucket layout mismatch check in 
OMLifecycleConfigurationSetRequest.preExecute() may also return 
INVALID_REQUEST, So it may also mapped to INVALID_ARGUMENT which doesn't make 
sense. Can you check this and update the patch?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to