fmorg-git commented on code in PR #10197:
URL: https://github.com/apache/ozone/pull/10197#discussion_r3398774552


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/endpoint/ObjectEndpoint.java:
##########
@@ -1103,22 +1107,25 @@ private CopyObjectResponse copyObject(OzoneVolume 
volume,
         throw ex;
       }
 
-      try (OzoneInputStream src = getClientProtocol().getKey(volume.getName(),
-          sourceBucket, sourceKey)) {
+      try (OzoneInputStream src = runWithS3ActionString(
+              "GetObject", () -> getClientProtocol().getKey(volume.getName(), 
sourceBucket, sourceKey));
+           DigestInputStream sourceDigestInputStream = new 
DigestInputStream(src, md5Digest)) {
         getMetrics().updateCopyKeyMetadataStats(startNanos);
-        sourceDigestInputStream = new DigestInputStream(src, 
getMD5DigestInstance());
-        copy(volume, sourceDigestInputStream, sourceKeyLen, destkey, 
destBucket, replicationConfig,
-                customMetadata, perf, startNanos, tags, writeConditions);
-      }
+        runWithS3ActionString("PutObject", () -> {
+          copy(volume, sourceDigestInputStream, sourceKeyLen, destkey, 
destBucket,
+              replicationConfig, customMetadata, perf, startNanos, tags, 
writeConditions);
+          return null;
+        });
 
-      final OzoneKeyDetails destKeyDetails = getClientProtocol().getKeyDetails(
-          volume.getName(), destBucket, destkey);
+        final OzoneKeyDetails destKeyDetails = 
getClientProtocol().getKeyDetails(
+            volume.getName(), destBucket, destkey);

Review Comment:
   yes, the concern is correct, the suggested fix is incorrect.  It is fixed in 
the follow-on PR https://github.com/apache/ozone/pull/10203/changes by removing 
the extra `destKeyDetails` call (which will help performance as well).



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