Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ public void testUploadPartOverrideWithRatis() throws IOException {
// comparing part names and large file uploads work using aws cp.
Assert.assertEquals("Part names should be same", partName,
commitUploadPartInfo.getPartName());

// old part bytes written needs discard and have only
// new part bytes in quota for this bucket
long byteWritten = "name".length() * 3; // data written with replication
Assert.assertEquals(volume.getBucket(bucketName).getUsedBytes(),
byteWritten);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,12 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
omBucketInfo = getBucketInfo(omMetadataManager, volumeName, bucketName);

long correctedSpace = omKeyInfo.getReplicatedSize();
// TODO: S3MultipartUpload did not check quota and did not add nameSpace,
// we need to fix these issues in HDDS-6650.
if (null != oldPartKeyInfo) {
OmKeyInfo partKeyToBeDeleted =
OmKeyInfo.getFromProtobuf(oldPartKeyInfo.getPartKeyInfo());
correctedSpace -= partKeyToBeDeleted.getReplicatedSize();
}
checkBucketQuotaInBytes(omBucketInfo, correctedSpace);
omBucketInfo.incrUsedBytes(correctedSpace);

omResponse.setCommitMultiPartUploadResponse(
Expand Down