You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/13 13:15:36 UTC

[GitHub] [hadoop] lokeshj1703 commented on a change in pull request #1278: HDDS-1950. S3 MPU part-list call fails if there are no parts

lokeshj1703 commented on a change in pull request #1278: HDDS-1950. S3 MPU part-list call fails if there are no parts
URL: https://github.com/apache/hadoop/pull/1278#discussion_r313386459
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/KeyManagerImpl.java
 ##########
 @@ -1329,8 +1329,16 @@ public OmMultipartUploadListParts listParts(String volumeName,
             multipartKeyInfo.getPartKeyInfoMap();
         Iterator<Map.Entry<Integer, PartKeyInfo>> partKeyInfoMapIterator =
             partKeyInfoMap.entrySet().iterator();
-        HddsProtos.ReplicationType replicationType =
-            partKeyInfoMap.firstEntry().getValue().getPartKeyInfo().getType();
+
+        OmKeyInfo omKeyInfo =
+            metadataManager.getOpenKeyTable().get(multipartKey);
+
+        if (omKeyInfo == null) {
+          throw new IllegalStateException(
+              "Open key is missing for multipart upload " + multipartKey);
+        }
+
+        HddsProtos.ReplicationType replicationType = omKeyInfo.getType();
 
 Review comment:
   We are setting replicationType twice- line 1358 and 1341. Can we add this openKeyTable get op inside an if condition so that it is executed only if no parts are present in the key?

----------------------------------------------------------------
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: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org