You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "szetszwo (via GitHub)" <gi...@apache.org> on 2023/05/02 15:51:53 UTC

[GitHub] [ozone] szetszwo commented on a diff in pull request #4602: HDDS-8462. Key in deleteTable uniqueness

szetszwo commented on code in PR #4602:
URL: https://github.com/apache/ozone/pull/4602#discussion_r1181882746


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -247,11 +251,10 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       OmKeyInfo pseudoKeyInfo = wrapUncommittedBlocksAsPseudoKey(uncommitted,
           omKeyInfo);
       if (pseudoKeyInfo != null) {
-        if (oldKeyVersionsToDelete != null) {
-          oldKeyVersionsToDelete.addOmKeyInfo(pseudoKeyInfo);
-        } else {
-          oldKeyVersionsToDelete = new RepeatedOmKeyInfo(pseudoKeyInfo);
-        }
+        String delKeyName = omMetadataManager.getOzoneDeletePathKey(
+            trxnLogIndex, dbOzoneKey);

Review Comment:
   We probably should not pass `trxnLogIndex` as an object id.  What if it collides with an existing object id?



##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyCommitRequest.java:
##########
@@ -195,7 +195,8 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
       // 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 oldKeyVersionsToDelete = null;
+      Map<String, RepeatedOmKeyInfo> oldKeyVersionsToDeleteMap
+          = new HashMap<>();

Review Comment:
   We should create a new HashMap only when there is a `keyToDelete`.  Otherwise, it will create a lot of empty HashMap objects.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org