hanishakoneru 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_r372050864
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMFileCreateRequest.java
##########
@@ -254,36 +294,88 @@ public OMClientResponse
validateAndUpdateCache(OzoneManager ozoneManager,
OmBucketInfo bucketInfo = omMetadataManager.getBucketTable().get(
omMetadataManager.getBucketKey(volumeName, bucketName));
encryptionInfo = getFileEncryptionInfo(ozoneManager, bucketInfo);
- omKeyInfo = prepareKeyInfo(omMetadataManager, keyArgs,
- omMetadataManager.getOzoneKey(volumeName, bucketName,
- keyName), keyArgs.getDataSize(), locations,
- encryptionInfo.orNull(), ozoneManager.getPrefixManager(),
- bucketInfo, transactionLogIndex);
-
- omClientResponse = prepareCreateKeyResponse(keyArgs, omKeyInfo,
- locations, encryptionInfo.orNull(), exception,
- createFileRequest.getClientID(), transactionLogIndex, volumeName,
- bucketName, keyName, ozoneManager,
- OMAction.CREATE_FILE, ozoneManager.getPrefixManager(), bucketInfo);
+
+ omKeyInfo = prepareKeyInfo(omMetadataManager, keyArgs, dbKeyInfo,
+ keyArgs.getDataSize(), locations, encryptionInfo.orNull(),
+ ozoneManager.getPrefixManager(), bucketInfo, trxnLogIndex);
+
+ long openVersion = omKeyInfo.getLatestVersionLocations().getVersion();
Review comment:
The issue is we have to get the openVersion before appending new blocks.
Hence, I kept these lines out of prepareKeyInfo.
I can add the appendBlocks and updateCache calls to another method. But
since it was just 2 calls, i though it could be outside.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]