list-multipart-uploads result contains wrong keys #185

Closed
opened 2023-08-16 08:14:07 +00:00 by dkirillov · 0 comments
Collaborator

List multipart uploads return uploads with wrong keys

Expected Behavior

List uploads results must contain keys of object for which multipart upload was started (e.g. /my/object/key).

Current Behavior

List uploads results contain only last part of keys of objects (e.g. key).

Possible Solution

Make upload listing in the tree the same as object listing

Steps to Reproduce (for bugs)

  1. Create bucket
$ aws s3api --endpoint http://localhost:8084  create-bucket   --bucket uploads 
  1. Create multipart upload
$ aws s3api --endpoint http://localhost:8084  create-multipart-upload   --bucket uploads --key /my/object/key 
{
    "Bucket": "uploads",
    "Key": "/my/object/key",
    "UploadId": "1b5c011e-9678-46e4-ab0f-7ccd4f4fd137"
}
  1. List multipart uploads (key must be /my/object/key rather than just key)
$ aws s3api --endpoint http://localhost:8084  list-multipart-uploads   --bucket uploads 
{
    "Uploads": [
        {
            "UploadId": "1b5c011e-9678-46e4-ab0f-7ccd4f4fd137",
            "Key": "key",
            "Initiated": "2023-08-16T08:10:57+00:00",
            "Owner": {
                "DisplayName": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt",
                "ID": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt"
            },
            "Initiator": {
                "ID": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt",
                "DisplayName": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt"
            }
        }
    ],
    "RequestCharged": null
}

Context

Was found in harbor integration

Regression

Probably yes. It seems when we switched to tree using such listing stop working correctly

Your Environment

List multipart uploads return uploads with wrong keys ## Expected Behavior List uploads results must contain keys of object for which multipart upload was started (e.g. `/my/object/key`). ## Current Behavior List uploads results contain only last part of keys of objects (e.g. `key`). ## Possible Solution Make [upload listing](https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/6b109eee92e8b7bb00d9071de8d91939a39b609e/pkg/service/tree/tree.go#L877) in the tree the same as [object listing](https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/src/commit/6b109eee92e8b7bb00d9071de8d91939a39b609e/pkg/service/tree/tree.go#L706) ## Steps to Reproduce (for bugs) 1. Create bucket ``` $ aws s3api --endpoint http://localhost:8084 create-bucket --bucket uploads ``` 2. Create multipart upload ``` $ aws s3api --endpoint http://localhost:8084 create-multipart-upload --bucket uploads --key /my/object/key { "Bucket": "uploads", "Key": "/my/object/key", "UploadId": "1b5c011e-9678-46e4-ab0f-7ccd4f4fd137" } ``` 3. List multipart uploads (key must be `/my/object/key` rather than just `key`) ``` $ aws s3api --endpoint http://localhost:8084 list-multipart-uploads --bucket uploads { "Uploads": [ { "UploadId": "1b5c011e-9678-46e4-ab0f-7ccd4f4fd137", "Key": "key", "Initiated": "2023-08-16T08:10:57+00:00", "Owner": { "DisplayName": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt", "ID": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt" }, "Initiator": { "ID": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt", "DisplayName": "NUUb82KR2JrVByHs2YSKgtK29gKnF5q6Vt" } } ], "RequestCharged": null } ``` ## Context Was found in harbor integration ## Regression Probably yes. It seems when we switched to [tree using](https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/commit/e1b9a4432aeee392e0c8f36d79f58163371a50d9) such listing stop working correctly ## Your Environment * Version used: [current master](https://git.frostfs.info/TrueCloudLab/frostfs-s3-gw/commit/6b109eee92e8b7bb00d9071de8d91939a39b609e) * Server setup and configuration: devenv
dkirillov added this to the v0.28.0 milestone 2023-08-16 08:14:07 +00:00
dkirillov added the
bug
label 2023-08-16 08:14:07 +00:00
dkirillov self-assigned this 2023-08-16 08:14:08 +00:00
alexvanin referenced this issue from a commit 2023-08-25 08:33:02 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
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: TrueCloudLab/frostfs-s3-gw#185
There is no content yet.