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 2022/12/16 04:20:49 UTC
[GitHub] [ozone] sumitagrawl commented on a diff in pull request #4095: HDDS-7649. S3 multipart upload EC release space quota wrong for old version
sumitagrawl commented on code in PR #4095:
URL: https://github.com/apache/ozone/pull/4095#discussion_r1050358200
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientMultipartUploadWithFSO.java:
##########
@@ -311,6 +315,118 @@ public void testUploadPartOverrideWithRatis() throws IOException {
commitUploadPartInfo.getPartName());
}
+ @Test
+ public void testUploadTwiceWithEC() throws IOException {
+
+ String volumeName = UUID.randomUUID().toString();
+ String bucketName = UUID.randomUUID().toString();
+ String keyName = UUID.randomUUID().toString();
+ StringBuilder sb = new StringBuilder("sample Value");
+ for (int i = 0; i < 4096; ++i) {
+ sb.append("01234567890123456789");
+ }
+ String sampleData = sb.toString();
+
+ store.createVolume(volumeName);
+ OzoneVolume volume = store.getVolume(volumeName);
+ OzoneBucket bucket = getOzoneECBucket(volumeName, bucketName);
+
+ // perform upload and complete
+ OmMultipartInfo multipartInfo = bucket.initiateMultipartUpload(keyName,
+ bucket.getReplicationConfig());
+
+ String uploadID = multipartInfo.getUploadID();
+ int partNumber = 1;
+
+ OzoneOutputStream ozoneOutputStream = bucket.createMultipartKey(keyName,
+ sampleData.length(), partNumber, uploadID);
+ ozoneOutputStream.write(string2Bytes(sampleData), 0, sampleData.length());
+ ozoneOutputStream.close();
+
+ OmMultipartCommitUploadPartInfo commitUploadPartInfo = ozoneOutputStream
+ .getCommitUploadPartInfo();
+
+ String partName = commitUploadPartInfo.getPartName();
+ Map<Integer, String> partsMap = new HashMap<>();
+ partsMap.put(partNumber, partName);
+ bucket.completeMultipartUpload(keyName, uploadID, partsMap);
+
+ Assert.assertEquals(volume.getBucket(bucketName).getUsedBytes(), 137228);
Review Comment:
@sodonnel Updated...
--
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