-
Notifications
You must be signed in to change notification settings - Fork 275
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
[S3] Validate parts in multi-part upload #2981
Conversation
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Outdated
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Show resolved
Hide resolved
ambry-frontend/src/main/java/com/github/ambry/frontend/s3/S3MultipartCompleteUploadHandler.java
Show resolved
Hide resolved
ambry-frontend/src/test/java/com/github/ambry/frontend/S3MultipartUploadTest.java
Show resolved
Hide resolved
|
||
Set<Integer> partNumbers = new HashSet<>(); | ||
Set<String> etags = new HashSet<>(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove Whitespace
for (Part part : parts) { | ||
int partNumber = part.getPartNumber(); | ||
String etag = part.geteTag(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rm white space
"Invalid part number: " + part.getPartNumber() + ". Part number must be an integer between {} and {}.", | ||
MIN_PART_NUM, MAX_PART_NUM); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rm white space
if (!partNumbers.add(partNumber)) { | ||
return "Duplicate part number found: " + partNumber; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rm white space
Nit : change title to Make sure this is the title when merging else github will use the original title |
d16b951
to
7c1ebb6
Compare
85c1b2a
to
3b9c81e
Compare
Currently there's no check for the invalid part number and duplicate etags. Add checks for part number that is negative, decimal or larger than 10000, throw Bad Request Error. Add checks for duplicate eTags in the request to avoid time out.