Copilot commented on code in PR #12027:
URL: https://github.com/apache/ozone/pull/12027#discussion_r4546042509
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/key/OMKeyDeleteRequest.java:
##########
@@ -156,6 +156,11 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager, Execut
}
validateIfMatchETag(keyArgs, omKeyInfo);
+ if (deleteKeyRequest.hasUpdateID() && omKeyInfo.getUpdateID() !=
deleteKeyRequest.getUpdateID()) {
+ throw new OMException("UpdateID does not match. Key: " + keyName +
+ ", Expected UpdateID: " + omKeyInfo.getUpdateID() +
+ ", Given UpdateID: " + deleteKeyRequest.getUpdateID(),
OMException.ResultCodes.UPDATE_ID_NOT_MATCH);
+ }
Review Comment:
The added lifecycle regression test exercises only FSO directories, so it
does not cover this new update-ID precondition in the LEGACY/OBS handler.
Please add cases to `TestOMKeyDeleteRequest` for matching and mismatching IDs,
including preservation of the key and bucket quota on `UPDATE_ID_NOT_MATCH`,
and verify that `preExecute` retains the supplied ID. The existing
ETag-precondition tests provide suitable scaffolding.
--
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]