ivandika3 commented on PR #9340:
URL: https://github.com/apache/ozone/pull/9340#issuecomment-3677791258

   I have tested it in the AWS S3 SDK, the behaviors are as follow
   - Abort multipart upload that was initiated before (i.e. it exists before): 
This might return 204 to show that there is a successful abort multipart upload 
before (idempotent)
   - Abort multipart upload that was never initiated (i.e. it does not exist): 
This might return 404 **None** since there was no successful abort itself.
   
   Since there is this distinction, we cannot simply returns 204 for 
non-existent key.
   
   I asked Claude on Cursor about this and the result is as follows
   
   
[cursor_s3_abort_multipart_upload_http_s.md](https://github.com/user-attachments/files/24271694/cursor_s3_abort_multipart_upload_http_s.md)
   
   This means that abort multipart uploads can return 204 first and then 404 
after some time. 
   
   Following are the commands I used:
   
   # Abort multipart upload that never exists
   ```
   AWS_ACCESS_KEY_ID=REDACTED AWS_SECRET_ACCESS_KEY=REDACTEDREGION=us-east-2 
aws --debug s3api abort-multipart-upload \
       --bucket test-ivan-andika \
       --key multipart/01 \
       --upload-id 
dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R
   ```
   ```
   2025-12-20 20:14:56,539 - MainThread - urllib3.connectionpool - DEBUG - 
https://test-ivan-andika.s3.us-east-2.amazonaws.com:443 "DELETE 
/multipart/01?uploadId=dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R
 HTTP/1.1" 404 None
   2025-12-20 20:14:56,541 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
_handle_200_error at 0x110588400>
   2025-12-20 20:14:56,541 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
handle_expires_header at 0x110588220>
   2025-12-20 20:14:56,541 - MainThread - botocore.parsers - DEBUG - Response 
headers: {'x-amz-request-id': 'MZPG73CN5097BBSB', 'x-amz-id-2': 
'NB0Lv0hTEVPrLM79pmyDkA0BXQozLcx9IgmOkE7OP3GTxpwEsHpFDMGCGWJAkvGz7sNFLav4GZkOtc6sw4owatueozuqNrKu',
 'Content-Type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Date': 
'Sat, 20 Dec 2025 12:14:56 GMT', 'Server': 'AmazonS3'}
   2025-12-20 20:14:56,541 - MainThread - botocore.parsers - DEBUG - Response 
body:
   b'<?xml version="1.0" 
encoding="UTF-8"?>\n<Error><Code>NoSuchUpload</Code><Message>The specified 
upload does not exist. The upload ID may be invalid, or the upload may have 
been aborted or 
completed.</Message><UploadId>dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R</UploadId><RequestId>MZPG73CN5097BBSB</RequestId><HostId>NB0Lv0hTEVPrLM79pmyDkA0BXQozLcx9IgmOkE7OP3GTxpwEsHpFDMGCGWJAkvGz7sNFLav4GZkOtc6sw4owatueozuqNrKu</HostId></Error>'
   2025-12-20 20:14:56,547 - MainThread - botocore.parsers - DEBUG - Response 
headers: {'x-amz-request-id': 'MZPG73CN5097BBSB', 'x-amz-id-2': 
'NB0Lv0hTEVPrLM79pmyDkA0BXQozLcx9IgmOkE7OP3GTxpwEsHpFDMGCGWJAkvGz7sNFLav4GZkOtc6sw4owatueozuqNrKu',
 'Content-Type': 'application/xml', 'Transfer-Encoding': 'chunked', 'Date': 
'Sat, 20 Dec 2025 12:14:56 GMT', 'Server': 'AmazonS3'}
   2025-12-20 20:14:56,547 - MainThread - botocore.parsers - DEBUG - Response 
body:
   b'<?xml version="1.0" 
encoding="UTF-8"?>\n<Error><Code>NoSuchUpload</Code><Message>The specified 
upload does not exist. The upload ID may be invalid, or the upload may have 
been aborted or 
completed.</Message><UploadId>dfRtDYU0WWCCcH43C3WFbkRONycyCpTJJvxu2i5GYkZljF.Yxwh6XG7WfS2vC4to6HiV6Yjlx.cph0gtNBtJ8P3URCSbB7rjxI5iEwVDmgaXZOGgkk5nVTW16HOQ5l0R</UploadId><RequestId>MZPG73CN5097BBSB</RequestId><HostId>NB0Lv0hTEVPrLM79pmyDkA0BXQozLcx9IgmOkE7OP3GTxpwEsHpFDMGCGWJAkvGz7sNFLav4GZkOtc6sw4owatueozuqNrKu</HostId></Error>'
   ```
   # Abort multipart upload that exists
   
   # Init
   
   ```
   AWS_ACCESS_KEY_ID=REDACTED AWS_SECRET_ACCESS_KEY=REDACTED REGION=us-east-2 
aws --debug s3api create-multipart-upload \
       --bucket test-ivan-andika \
       --key test-multipart-key
   ```
   ```
   {
       "ServerSideEncryption": "AES256",
       "Bucket": "test-ivan-andika",
       "Key": "test-multipart-key",
       "UploadId": 
"NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-"
   }
   ```
   
   
   # First abort (204)
   ```
   AWS_ACCESS_KEY_ID=REDACTED AWS_SECRET_ACCESS_KEY=REDACTED REGION=us-east-2 
aws --debug s3api abort-multipart-upload \
       --bucket test-ivan-andika \
       --key test-multipart-key \
       --upload-id 
NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-
   ```
   
   ```
   2025-12-20 20:22:30,115 - MainThread - botocore.endpoint - DEBUG - Sending 
http request: <AWSPreparedRequest stream_output=False, method=DELETE, 
url=https://test-ivan-andika.s3.us-east-2.amazonaws.com/test-multipart-key?uploadId=NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-,
 headers={'User-Agent': b'aws-cli/2.27.2 md/awscrt#0.25.4 ua/2.1 
os/macos#24.5.0 md/arch#x86_64 lang/python#3.13.2 md/pyimpl#CPython 
cfg/retry-mode#standard md/installer#exe md/prompt#off 
md/command#s3api.abort-multipart-upload', 'X-Amz-Date': b'20251220T122230Z', 
'X-Amz-Content-SHA256': 
b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 
'Authorization': b'AWS4-HMAC-SHA256 
Credential=REDACTED/20251220/us-east-2/s3/aws4_request, 
SignedHeaders=host;x-amz-content-sha256;x-amz-date, 
Signature=101f571ec687f53daf7336e9b19cbdaa418dd4f06de451405f9192612987d197', 
'Content-Length': '0'}>
   2025-12-20 20:22:30,116 - MainThread - botocore.httpsession - DEBUG - 
Certificate path: /usr/local/aws-cli/awscli/botocore/cacert.pem
   2025-12-20 20:22:30,116 - MainThread - urllib3.connectionpool - DEBUG - 
Starting new HTTPS connection (1): 
test-ivan-andika.s3.us-east-2.amazonaws.com:443
   2025-12-20 20:22:30,976 - MainThread - urllib3.connectionpool - DEBUG - 
https://test-ivan-andika.s3.us-east-2.amazonaws.com:443 "DELETE 
/test-multipart-key?uploadId=NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-
 HTTP/1.1" 204 0
   2025-12-20 20:22:30,979 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
_handle_200_error at 0x10e2d8540>
   2025-12-20 20:22:30,981 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
handle_expires_header at 0x10e2d8360>
   2025-12-20 20:22:30,982 - MainThread - botocore.parsers - DEBUG - Response 
headers: {'x-amz-id-2': 
'OwpZO5xYKfeuFO7meLGjdMi6PwMAV2P2i1RItY0dYZ4x5nGwLfBDgr5qahFc3EoTYTlYZMofAzw=', 
'x-amz-request-id': 'HTA67X9B7ER7EZX2', 'Date': 'Sat, 20 Dec 2025 12:22:31 
GMT', 'Server': 'AmazonS3'}
   2025-12-20 20:22:30,982 - MainThread - botocore.parsers - DEBUG - Response 
body:
   b''
   2025-12-20 20:22:30,985 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <function 
_update_status_code at 0x10e2d8680>
   2025-12-20 20:22:30,985 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <bound method 
RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 
0x112002a50>>
   2025-12-20 20:22:30,985 - MainThread - botocore.retries.standard - DEBUG - 
Not retrying request.
   2025-12-20 20:22:30,985 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <bound method 
S3RegionRedirectorv2.redirect_from_error of 
<botocore.utils.S3RegionRedirectorv2 object at 0x112002ba0>>
   2025-12-20 20:22:30,986 - MainThread - botocore.hooks - DEBUG - Event 
after-call.s3.AbortMultipartUpload: calling handler <function enhance_error_msg 
at 0x10ffba2a0>
   2025-12-20 20:22:30,986 - MainThread - botocore.hooks - DEBUG - Event 
after-call.s3.AbortMultipartUpload: calling handler <bound method 
RetryQuotaChecker.release_retry_quota of 
<botocore.retries.standard.RetryQuotaChecker object at 0x112001940>>
   2025-12-20 20:22:30,986 - MainThread - awscli.formatter - DEBUG - RequestId: 
HTA67X9B7ER7EZX2
   ```
   
   # Second abort (also 204)
   
   ```
   AWS_ACCESS_KEY_ID=REDACTED AWS_SECRET_ACCESS_KEY=REDACTED REGION=us-east-2 
aws --debug s3api abort-multipart-upload \
       --bucket test-ivan-andika \
       --key test-multipart-key \
       --upload-id 
NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-
   
   2025-12-20 20:23:16,862 - MainThread - botocore.endpoint - DEBUG - Sending 
http request: <AWSPreparedRequest stream_output=False, method=DELETE, 
url=https://test-ivan-andika.s3.us-east-2.amazonaws.com/test-multipart-key?uploadId=NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-,
 headers={'User-Agent': b'aws-cli/2.27.2 md/awscrt#0.25.4 ua/2.1 
os/macos#24.5.0 md/arch#x86_64 lang/python#3.13.2 md/pyimpl#CPython 
cfg/retry-mode#standard md/installer#exe md/prompt#off 
md/command#s3api.abort-multipart-upload', 'X-Amz-Date': b'20251220T122316Z', 
'X-Amz-Content-SHA256': 
b'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', 
'Authorization': b'AWS4-HMAC-SHA256 
Credential=REDACTED/20251220/us-east-2/s3/aws4_request, 
SignedHeaders=host;x-amz-content-sha256;x-amz-date, 
Signature=a93be57eb5736f616ed763ab9417b7db8eebec6e8b2c4b261227b6e550e63dbf', 
'Content-Length': '0'}>
   2025-12-20 20:23:16,862 - MainThread - botocore.httpsession - DEBUG - 
Certificate path: /usr/local/aws-cli/awscli/botocore/cacert.pem
   2025-12-20 20:23:16,862 - MainThread - urllib3.connectionpool - DEBUG - 
Starting new HTTPS connection (1): 
test-ivan-andika.s3.us-east-2.amazonaws.com:443
   2025-12-20 20:23:17,709 - MainThread - urllib3.connectionpool - DEBUG - 
https://test-ivan-andika.s3.us-east-2.amazonaws.com:443 "DELETE 
/test-multipart-key?uploadId=NoRtyL9CXYLPCDUMviHts491NsNlJzeRnOx.6ADN9bT6iEpeNYUcFR.WQ_xX7rqlsgwQcJbAkgDDdeFUq4qOBx4DYyqFZFGygI3vUUru6UM-
 HTTP/1.1" 204 0
   2025-12-20 20:23:17,710 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
_handle_200_error at 0x110c78540>
   2025-12-20 20:23:17,710 - MainThread - botocore.hooks - DEBUG - Event 
before-parse.s3.AbortMultipartUpload: calling handler <function 
handle_expires_header at 0x110c78360>
   2025-12-20 20:23:17,710 - MainThread - botocore.parsers - DEBUG - Response 
headers: {'x-amz-id-2': 
'/I+m1LdKqfAjQXI6mZG8vn5+6b+I/icFckf36ixwvK4DpuIkHBFFAIpDEC9BxHNIywUJY/22PLY=', 
'x-amz-request-id': 'EZ0C366D8H536DCT', 'Date': 'Sat, 20 Dec 2025 12:23:18 
GMT', 'Server': 'AmazonS3'}
   2025-12-20 20:23:17,711 - MainThread - botocore.parsers - DEBUG - Response 
body:
   b''
   2025-12-20 20:23:17,712 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <function 
_update_status_code at 0x110c78680>
   2025-12-20 20:23:17,713 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <bound method 
RetryHandler.needs_retry of <botocore.retries.standard.RetryHandler object at 
0x1149d2a50>>
   2025-12-20 20:23:17,713 - MainThread - botocore.retries.standard - DEBUG - 
Not retrying request.
   2025-12-20 20:23:17,713 - MainThread - botocore.hooks - DEBUG - Event 
needs-retry.s3.AbortMultipartUpload: calling handler <bound method 
S3RegionRedirectorv2.redirect_from_error of 
<botocore.utils.S3RegionRedirectorv2 object at 0x1149d2ba0>>
   2025-12-20 20:23:17,713 - MainThread - botocore.hooks - DEBUG - Event 
after-call.s3.AbortMultipartUpload: calling handler <function enhance_error_msg 
at 0x11296e2a0>
   2025-12-20 20:23:17,713 - MainThread - botocore.hooks - DEBUG - Event 
after-call.s3.AbortMultipartUpload: calling handler <bound method 
RetryQuotaChecker.release_retry_quota of 
<botocore.retries.standard.RetryQuotaChecker object at 0x1149d1940>>
   2025-12-20 20:23:17,714 - MainThread - awscli.formatter - DEBUG - RequestId: 
EZ0C366D8H536DCT
   ```
   
   # list-multipart-upload
   ```
   AWS_ACCESS_KEY_ID=REDACTED AWS_SECRET_ACCESS_KEY=REDACTED REGION=us-east-2 
aws --debug s3api list-multipart-uploads \
       --bucket test-ivan-andika
   
   {
       "RequestCharged": null,
       "Prefix": null
   }
   ```


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