[
https://issues.apache.org/jira/browse/HDDS-1950?focusedWorklogId=293885&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-293885
]
ASF GitHub Bot logged work on HDDS-1950:
----------------------------------------
Author: ASF GitHub Bot
Created on: 13/Aug/19 13:15
Start Date: 13/Aug/19 13:15
Worklog Time Spent: 10m
Work Description: lokeshj1703 commented on 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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 293885)
Time Spent: 40m (was: 0.5h)
> S3 MPU part-list call fails if there are no parts
> -------------------------------------------------
>
> Key: HDDS-1950
> URL: https://issues.apache.org/jira/browse/HDDS-1950
> Project: Hadoop Distributed Data Store
> Issue Type: Bug
> Components: S3
> Reporter: Elek, Marton
> Assignee: Elek, Marton
> Priority: Major
> Labels: pull-request-available
> Time Spent: 40m
> Remaining Estimate: 0h
>
> If an S3 multipart upload is created but no part is upload the part list
> can't be called because it throws HTTP 500:
> Create an MPU:
> {code}
> aws s3api --endpoint http://localhost:9999 create-multipart-upload
> --bucket=docker --key=testkeu
> {
> "Bucket": "docker",
> "Key": "testkeu",
> "UploadId": "85343e71-4c16-4a75-bb55-01f56a9339b2-102592678478217234"
> }
> {code}
> List the parts:
> {code}
> aws s3api --endpoint http://localhost:9999 list-parts --bucket=docker
> --key=testkeu
> --upload-id=85343e71-4c16-4a75-bb55-01f56a9339b2-102592678478217234
> {code}
> It throws an exception on the server side, because in the
> KeyManagerImpl.listParts the ReplicationType is retrieved from the first
> part:
> {code}
> HddsProtos.ReplicationType replicationType =
> partKeyInfoMap.firstEntry().getValue().getPartKeyInfo().getType();
> {code}
> Which is not yet available in this use case.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]