HDDS-6709. Fix bucket usedBytes while versioning is true.#3388
HDDS-6709. Fix bucket usedBytes while versioning is true.#3388captainzmc merged 1 commit intoapache:masterfrom
Conversation
errose28
left a comment
There was a problem hiding this comment.
LGTM, just a minor nit on the test. @captainzmc up to you whether you want to merge this or #3286 first, so you can resolve possible merge conflicts in the one that gets merged second.
There was a problem hiding this comment.
Test looks good, but can we use org.junit.jupiter.params.ParameterizedTest for the bucket layout types, instead of new test methods, similar to what the EC tests are doing for replication config in this class?
There was a problem hiding this comment.
Sure. Let's change test using ParameterizedTest.
There was a problem hiding this comment.
Nit: Might be cleaner to combine the identical if conditions here and line 158
There was a problem hiding this comment.
Good point. Let's combine the identical.
There was a problem hiding this comment.
Might as well combine all the versioned bucker handling here and line 224
|
Good catch and thank you for fixing it! I'm afraid the same bug resides in committing multipart objects via S3 API: https://github.com/apache/ozone/blob/d1117ebe1689eb51695594c4a37a6f1a1672523f/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/s3/multipart/S3MultipartUploadCompleteRequest.java#L225-L244 Fixing it in this issue or another one, either would be fine for me. |
Thanks @kuenishi for the tip, let's fix it in this PR. |
|
Thanks @errose28 @kerneltime @kuenishi for the review. Let's merge this. |
What changes were proposed in this pull request?
If Bucket versioning is set to true, the key should be able to keep multiple versions. And the keyToDelete in OMKeyCommitRequest will not be deleted. At this time the keyToDelete's usedBytes also should not detracted.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-6709
How was this patch tested?
UT has added.