kuenishi commented on a change in pull request #2813:
URL: https://github.com/apache/ozone/pull/2813#discussion_r817467897



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java
##########
@@ -205,9 +210,29 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
           }
         }
 
+        // If bucket versioning is turned on during the update, between key
+        // creation and key commit, old versions will be just overwritten and
+        // not kept. Bucket versioning will be effective from the first key
+        // creation after the knob turned on.
+        RepeatedOmKeyInfo keysToDelete = getOldVersionsToCleanUp(dbOzoneKey,
+            omMetadataManager, omBucketInfo.getIsVersionEnabled(),
+            trxnLogIndex, ozoneManager.isRatisEnabled());
+        OmKeyInfo keyToDelete =
+            omMetadataManager.getKeyTable(getBucketLayout()).get(dbOzoneKey);

Review comment:
       Good catch. I applied the optimization to all three classes.




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