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



##########
File path: 
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java
##########
@@ -192,6 +195,16 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager,
       // Set the UpdateID to current transactionLogIndex
       omKeyInfo.setUpdateID(trxnLogIndex, ozoneManager.isRatisEnabled());
 
+      // 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 =

Review comment:
       Sorry, I don't get your comment. My guess is that some read operation 
should be added to the batch in OMKeyCommitResponse?
   
   If so, to protect the data from race conditions, I don't think the read op 
in the batch is needed because `validateAndUpdateCache(...)` is executed in a 
serialized manner at OMs.




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