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

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

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


##########
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.
+    String partName3 = uploadPart(bucket, keyName, uploadID, 3, data);

Review Comment:
   Findbugs complains that `partName3` is not used.
   
   ```
   M D DLS: Dead store to partName3 in org.apache.hadoop.ozone.client.rpc.TestOzoneClientMultipartUploadWithFSO.testMultipartUploadWithDiscardedUnusedPartSize()  At TestOzoneClientMultipartUploadWithFSO.java:[line 382]
   ```
   
   https://github.com/ArafatKhan2198/ozone/actions/runs/6282746425/job/17062531321#step:6:2365
   
   Please try:
   
   ```suggestion
       uploadPart(bucket, keyName, uploadID, 3, data);
   ```



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