smengcl opened a new pull request, #11631:
URL: https://github.com/apache/ozone/pull/11631

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   `OMKeyRequest.prepareMultipartFileInfo` validated the multipart part number 
with `Preconditions.checkArgument`. So a CreateKey or CreateFile request for a 
multipart part with a part number below 1 failed with an 
`IllegalArgumentException` instead of an `OMException` with a result code.
   
   This PR throws `OMException` with `INVALID_PART` instead, so the request 
fails with a normal error response like other request validation in OM. 
`prepareMultipartFileInfo` is shared by `OMKeyCreateRequest`, 
`OMFileCreateRequest` and their FSO subclasses, so the one change covers all of 
them.
   
   The Ozone client and the S3 Gateway already reject part numbers below 1 
before sending the request, so they see no difference. No protocol, version or 
layout change.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17162
   
   ## How was this patch tested?
   
   - New `testValidateAndUpdateCacheWithInvalidPartNumber` in 
`TestOMKeyCreateRequest` (so also `TestOMKeyCreateRequestWithFSO`) and in 
`TestOMFileCreateRequest` (so also `TestOMFileCreateRequestWithFSO`), for part 
numbers 0 and -1. All 10 cases fail without the change with 
`IllegalArgumentException` and pass with it.
   - The four test classes pass locally (222 tests).
   - CI on fork: 
https://github.com/smengcl/hadoop-ozone/actions/runs/39324177105
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to