ChenSammi commented on code in PR #8681:
URL: https://github.com/apache/ozone/pull/8681#discussion_r2194290454


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeysDeleteRequest.java:
##########
@@ -164,6 +175,19 @@ public OMClientResponse 
validateAndUpdateCache(OzoneManager ozoneManager, Execut
           unDeletedKeys.addKeys(keyName);
           keyToError.put(keyName, new 
ErrorInfo(OMException.ResultCodes.KEY_NOT_FOUND.name(), "Key does not exist"));
           continue;
+        } else {
+          if (deleteKeyUpdateIDs != null) {
+            Long updateID = deleteKeyUpdateIDs.get(indexFailed);
+            if (updateID == null || updateID != omKeyInfo.getUpdateID()) {
+              deleteStatus = false;
+              LOG.warn("Received a request to delete a Key {} whose updateID 
not match or null", objectKey);
+              deleteKeys.remove(keyName);
+              unDeletedKeys.addKeys(keyName);
+              keyToError.put(keyName,
+                  new ErrorInfo(OMException.ResultCodes.METADATA_ERROR.name(), 
"UpdateID not match or null"));
+              continue;
+            }

Review Comment:
   @ivandika3 thanks for the review.  Will introduce a new error type.  
KEY_NOT_FOUND doesn't fit for this case. 



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