Skip to content

Fix bug about wrong part size number in CopyObjectHelper #4049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 30, 2023

Conversation

L-Applin
Copy link
Contributor

In CopyObjectHelper the method calculateOptimalPartSizeForCopy(long contentLengthOfSource) expect the content length of the whole object to copy, but is passed the part size instead. This PR is to fix that issue, now it is passed the content length so that the part size can be automatically adjusted if the total number of parts would exceed 10,000.

@L-Applin L-Applin requested a review from a team as a code owner May 29, 2023 16:03
Copy link
Contributor

@zoewangg zoewangg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a changelog entry?

@@ -130,7 +130,7 @@ private void doCopyInParts(CopyObjectRequest copyObjectRequest,
Long contentLength,
CompletableFuture<CopyObjectResponse> returnFuture,
String uploadId) {
long optimalPartSize = calculateOptimalPartSizeForCopy(partSizeInBytes);
long optimalPartSize = calculateOptimalPartSizeForCopy(contentLength);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦🏼‍♀️

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@L-Applin L-Applin merged commit 5aed13e into master May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants