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

   ## What changes were proposed in this pull request?
   
   In an FSO bucket, if the parent directory of an in-progress multipart upload 
is replaced by a file, `CompleteMultipartUpload` fails with 
`DIRECTORY_NOT_FOUND` while resolving the key. S3 Gateway has no mapping for 
that code, so the client gets HTTP 500 and retries.
   
   This PR rejects a file in the parent path with `NOT_A_FILE`, like 
`S3InitiateMultipartUploadRequestWithFSO` does since HDDS-17644. S3 Gateway 
already returns `NOT_A_FILE` as 400 `InvalidRequest`. The check now runs before 
the missing parent directories and the open key are added to the cache, so a 
rejected request leaves no cache entries behind. The S3 Gateway error message 
no longer says a directory exists, since the cause can now be a file.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17696
   
   ## How was this patch tested?
   
   Added two unit tests in `TestS3MultipartUploadCompleteRequestWithFSO`:
   
   - `testValidateAndUpdateCacheFileExistsInParentPath`: completing after the 
parent is replaced by a file returns `NOT_A_FILE` and leaves no open key in the 
cache.
   - `testValidateAndUpdateCacheParentDirectoryDeleted`: completing after the 
parent directory is only deleted still succeeds, so the earlier check does not 
reject it.
   
   - build-branch: https://github.com/chihsuan/ozone/actions/runs/41836567735
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
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