You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "ArafatKhan2198 (via GitHub)" <gi...@apache.org> on 2023/09/23 08:53:28 UTC

[GitHub] [ozone] ArafatKhan2198 commented on a diff in pull request #5231: HDDS-6399. Bucket usage should be updated on MultipartUploadComplete.

ArafatKhan2198 commented on code in PR #5231:
URL: https://github.com/apache/ozone/pull/5231#discussion_r1334945872


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java:
##########
@@ -360,6 +360,36 @@ public void testMultipartUploadWithPartsLessThanMinSize() throws Exception {
         () -> completeMultipartUpload(bucket, keyName, uploadID, partsMap));
   }
 
+  @Test
+  public void testMultipartUploadWithDiscardedUnusedPartSize()
+      throws Exception {
+    // Initiate multipart upload
+    String uploadID = initiateMultipartUpload(bucket, keyName, RATIS, ONE);
+    byte[] data = generateData(10000000, (byte) 97);
+
+    // Upload Parts
+    Map<Integer, String> partsMap = new TreeMap<>();
+
+    // Upload part 1 and add it to the partsMap for completing the upload.
+    String partName1 = uploadPart(bucket, keyName, uploadID, 1, data);
+    partsMap.put(1, partName1);
+
+    // Upload part 2 and add it to the partsMap for completing the upload.
+    String partName2 = uploadPart(bucket, keyName, uploadID, 2, data);
+    partsMap.put(2, partName2);
+
+    // Upload part 3 but do not add it to the partsMap for completing the
+    String partName3 = uploadPart(bucket, keyName, uploadID, 3, data);
+
+    completeMultipartUpload(bucket, keyName, uploadID, partsMap);
+
+    // Check the bucket size. Since part number 2 was not added to the partsMap,

Review Comment:
   Thanks for the find!
   I have made the changes!
   @sumitagrawl 



-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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