The gw deletes a bucket containing delete-markers #287

Closed
opened 2025-12-28 17:36:52 +00:00 by sami · 4 comments
Owner

Originally created by @masterSplinter01 on GitHub (Jul 20, 2022).

Originally assigned to: @KirillovDenis on GitHub.

In spec :

Deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted.

The gw (tree-service branch) deletes a bucket containing delete markers:

$ aws s3api list-object-versions  --bucket test6 --endpoint-url http://127.0.0.1:8084  | jq                                                                                                                    
{
  "DeleteMarkers": [
    {
      "Owner": {
        "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
        "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
      },
      "Key": "a",
      "VersionId": "Bc1nfBasAsdMnJ4UzGhFsM4kU55uEPQDbLqFYTBLzEBD",
      "IsLatest": true,
      "LastModified": "2022-07-20T18:02:31+00:00"
    }
  ]
}
$ aws s3api delete-bucket --bucket test6 --endpoint-url http://127.0.0.1:8084  | jq
# bucket is deleted
Originally created by @masterSplinter01 on GitHub (Jul 20, 2022). Originally assigned to: @KirillovDenis on GitHub. In [spec](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) : > Deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted. The gw (`tree-service` branch) deletes a bucket containing delete markers: ``` $ aws s3api list-object-versions --bucket test6 --endpoint-url http://127.0.0.1:8084 | jq { "DeleteMarkers": [ { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "a", "VersionId": "Bc1nfBasAsdMnJ4UzGhFsM4kU55uEPQDbLqFYTBLzEBD", "IsLatest": true, "LastModified": "2022-07-20T18:02:31+00:00" } ] } $ aws s3api delete-bucket --bucket test6 --endpoint-url http://127.0.0.1:8084 | jq # bucket is deleted ```
sami 2025-12-28 17:36:52 +00:00
Author
Owner

@KirillovDenis commented on GitHub (Jul 21, 2022):

This should be fixed by replacing:
nspcc-dev/neofs-s3-gw@f5ecb948fc/api/layer/layer.go (L593)
to

objects, err := n.getAllObjectsVersions(ctx, p.BktInfo, "", "")
@KirillovDenis commented on GitHub (Jul 21, 2022): This should be fixed by replacing: https://github.com/nspcc-dev/neofs-s3-gw/blob/f5ecb948fca8e3eea5553ca96edeb95c38a79c92/api/layer/layer.go#L593 to ```go objects, err := n.getAllObjectsVersions(ctx, p.BktInfo, "", "") ```
Author
Owner

@KirillovDenis commented on GitHub (Jul 21, 2022):

It seems this bug reproduced on the master too. Since we are going to merge tree-service to master we can fix it once here though.

@KirillovDenis commented on GitHub (Jul 21, 2022): It seems this bug reproduced on the `master` too. Since we are going to merge `tree-service` to master we can fix it once here though.
Author
Owner

@KirillovDenis commented on GitHub (Jul 21, 2022):

Related to #601

@KirillovDenis commented on GitHub (Jul 21, 2022): Related to #601
Author
Owner

@KirillovDenis commented on GitHub (Jul 21, 2022):

Done in #604

@KirillovDenis commented on GitHub (Jul 21, 2022): Done in #604
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#287
No description provided.