bharatviswa504 commented on a change in pull request #448: HDDS-2870. Handle replay of KeyCreate requests. URL: https://github.com/apache/hadoop-ozone/pull/448#discussion_r372019122
########## File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java ########## @@ -194,6 +212,28 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager, OMException.ResultCodes.NOT_A_FILE); } + // Check if Key already exists in KeyTable and this transaction is a + // replay. + String ozoneKey = omMetadataManager.getOzoneKey(volumeName, bucketName, + keyName); + OmKeyInfo dbKeyInfo = omMetadataManager.getKeyTable().get(ozoneKey); + if (dbKeyInfo != null) { + // Check if this transaction is a replay of ratis logs. + // Check if this transaction is a replay of ratis logs. Review comment: Minor: Duplicate // Check if this transaction is a replay of ratis logs. We can remove one. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: ozone-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: ozone-issues-h...@hadoop.apache.org