shuan1026 opened a new pull request, #11327: URL: https://github.com/apache/ozone/pull/11327
### What changes were proposed in this pull request? S3 `DeleteObjects` returns HTTP 200 with every key under `<Deleted>` when OM rejects the whole `DeleteKeys` request, because the `quiet=true` branch of `OzoneManagerProtocolClientSideTranslatorPB.deleteKeys` reads only the per-key `errors` list and never checks `OMResponse.status`. Details are on the Jira. This patch makes the `quiet` branch honour the whole-request status: - `deleteKeys(OmDeleteKeys, boolean quiet)`: before reading `errors`, call the existing `handleError(omResponse)` for any status other than `PARTIAL_DELETE`. - Javadoc of the `quiet` overload on `OzoneBucket`, `ClientProtocol` and `OzoneManagerProtocol`. Behaviour changes to note: - Public client API: `OzoneBucket.deleteKeys(list, true)` and the `quiet` overloads on `ClientProtocol` / `OzoneManagerProtocol` now throw `OMException` on a whole-request failure. The only in-repo caller (S3 Gateway) already handles it. - S3 visible: a whole-request failure becomes the matching S3 error (`NoSuchBucket` 404, `AccessDenied` 403, `InternalError` 500 for `INTERNAL_ERROR` / `METADATA_ERROR`) instead of a false 200, in line with AWS semantics. ### What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16604 ### How was this patch tested? - `TestOzoneManagerProtocolClientSideTranslatorPB` (mocked `OmTransport`), three new tests: whole-batch failure (`BUCKET_NOT_FOUND`, no `errors`) throws `OMException`; `PARTIAL_DELETE` with one `ACCESS_DENIED` entry returns the per-key map; `OK` returns an empty map. With the tests applied but not the fix, the first one fails with "nothing was thrown"; with the fix, 6 / 6 pass. - s3gateway regression: `TestObjectMultiDelete`, `TestPermissionCheck`: 26 / 26 pass. `TestPermissionCheck.testDeleteKeysTranslatesContainedOMFailures` already covers the Gateway's `OMException` to S3 error mapping. - ci: https://github.com/shuan1026/ozone/actions/runs/36133036725 -- 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]
