smengcl opened a new pull request, #11426: URL: https://github.com/apache/ozone/pull/11426
Generated-by: Claude Code (Fable 5.1, Opus 5.5) ## What changes were proposed in this pull request? Since HDDS-16591, `GET /bucket?versions` (ListObjectVersions) returns 501 NotImplemented. Before that, the request fell through to ListObjects and clients parsed the response as an empty version list. Bucket cleanup tools commonly call ListObjectVersions and then delete by the returned version IDs. The ceph/s3-tests cleanup fixture does so before and after each test, so the nightly S3 compatibility report dropped from 37.0% to 0.4% for s3-tests. Ozone does not support bucket versioning yet, so every bucket behaves like an AWS S3 bucket that never had versioning enabled. This PR makes S3 Gateway respond the way AWS S3 does for such a bucket: * ListObjectVersions lists each object as a single `Version` with `VersionId` `null` and `IsLatest` `true`, with no `DeleteMarker` entries. It reuses the existing key listing in `BucketEndpoint` and paginates with `key-marker`, `NextKeyMarker` and `NextVersionIdMarker`. `PUT` and `DELETE` on `?versions` are still rejected. * `null` is accepted as the version ID of the current object in DeleteObjects, DeleteObject, PutObjectTagging and DeleteObjectTagging. Any other version ID is still rejected with NotImplemented. * DeleteObjects returns `VersionId` in `Deleted` and `Error` entries when the request specified it. * The S3 interface doc lists ListObjectVersions. Not changed: the request is still audited and authorized as a bucket listing (`GET_BUCKET`), GetBucketVersioning still returns NotImplemented, and GetObject and HeadObject still ignore `versionId`. This is the unversioned subset of the ListObjectVersions work planned in HDDS-15728, which can extend it with the merged listing for versioned buckets. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-16739 ## How was this patch tested? * New unit tests in `TestBucketList`, `TestObjectMultiDelete`, `TestObjectNotImplemented`, `TestObjectTaggingPut` and `TestObjectTaggingDelete`. `TestBucketNotImplemented` now expects only `PUT` and `DELETE` on `?versions` to be rejected. * New AWS SDK v2 integration test `testDeleteObjectsListedByListObjectVersions`, which paginates ListObjectVersions, deletes the returned versions with DeleteObjects and checks that the bucket is empty. * Ran the s3gateway unit tests and `TestS3SDK` locally. 🤖 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]
