You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/02/04 05:02:12 UTC

[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #504: HDDS-2953. Handle replay of S3 requests

bharatviswa504 commented on a change in pull request #504: HDDS-2953. Handle replay of S3 requests
URL: https://github.com/apache/hadoop-ozone/pull/504#discussion_r374475299
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadAbortRequest.java
 ##########
 @@ -116,36 +122,51 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
         throw new OMException("Abort Multipart Upload Failed: volume: " +
             volumeName + "bucket: " + bucketName + "key: " + keyName,
             OMException.ResultCodes.NO_SUCH_MULTIPART_UPLOAD_ERROR);
-      } else {
-        multipartKeyInfo = omMetadataManager
-            .getMultipartInfoTable().get(multipartKey);
-
-        multipartKeyInfo.setUpdateID(transactionLogIndex);
-
-        // Update cache of openKeyTable and multipartInfo table.
-        // No need to add the cache entries to delete table, as the entries
-        // in delete table are not used by any read/write operations.
-        omMetadataManager.getOpenKeyTable().addCacheEntry(
-            new CacheKey<>(multipartKey),
-            new CacheValue<>(Optional.absent(), transactionLogIndex));
-        omMetadataManager.getMultipartInfoTable().addCacheEntry(
-            new CacheKey<>(multipartKey),
-            new CacheValue<>(Optional.absent(), transactionLogIndex));
       }
 
-      omClientResponse = new S3MultipartUploadAbortResponse(multipartKey,
-          multipartKeyInfo,
+      // Check the OpenKeyTable if this transaction is a replay of ratis logs.
+      if (isReplay(ozoneManager, omKeyInfo.getUpdateID(), trxnLogIndex)) {
 
 Review comment:
   How this check will help here, as we don't set updateID for open key OmKeyInfo.
   
   Example:
    T1 -> MPU Initiate
   T2 -> MPU abort
   
   Now replay, T2 will not be considered as a replay. As OmKeyInfo will have updateID as 1.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org