rich7420 commented on code in PR #11157:
URL: https://github.com/apache/ozone/pull/11157#discussion_r3889766936


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -685,6 +764,7 @@ public Response head(
     addLastModifiedDate(response, key);
     addTagCountIfAny(response, key);
     addCustomMetadataHeaders(response, key);
+    addExpirationHeader(response, bucketName, keyPath, key);

Review Comment:
   `addExpirationHeader` runs on every successful HEAD and makes a fresh 
`getLifecycleConfiguration` RPC that takes the bucket read lock. For a bucket 
with no lifecycle config (the common case) OM throws 
`LIFECYCLE_CONFIGURATION_NOT_FOUND`, logs it at ERROR with a stack trace 
(`OmMetadataManagerImpl#getLifecycleConfiguration`), and records an audit READ 
FAILURE, none of which the gateway `catch` can suppress. HEAD is a hot path, so 
this floods the OM and audit logs.
   
   Could we gate the lookup on the default path, e.g. cache the config in S3G 
or check a cheap "has lifecycle" flag on the bucket info HEAD already reads?



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