ivandika3 commented on code in PR #8681:
URL: https://github.com/apache/ozone/pull/8681#discussion_r2244827496
##########
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:
@ChenSammi Sorry for this late review, just want to double check whether
there are reasons why we use updateId instead of objectId?
##########
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:
@ChenSammi Sorry for this late review, just want to double check whether
there are reasons why we use updateId instead of objectId? I think both are OK,
but just checking.
--
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]