Revise delete-marker work #83

Closed
opened 2023-04-11 10:07:09 +00:00 by dkirillov · 1 comment
Member

Currently, we create delete-marker (in bucket with versioning enabled) even if:

  1. We have no object at all
$ aws s3api --endpoint http://localhost:8084 create-bucket  --bucket dkirillov

$ aws s3api --endpoint http://localhost:8084 put-bucket-versioning  --bucket dkirillov --versioning-configuration Status=Enabled

$ aws s3api --endpoint http://localhost:8084 get-bucket-versioning  --bucket dkirillov
{
    "Status": "Enabled"
}

$ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov

$ aws s3api --endpoint http://localhost:8084 delete-object --bucket dkirillov --key obj
{
    "DeleteMarker": true,
    "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH"
}

$ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov
{
    "DeleteMarkers": [
        {
            "Owner": {
                "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
                "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
            },
            "Key": "obj",
            "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH",
            "IsLatest": true,
            "LastModified": "2023-04-11T09:47:50+00:00"
        }
    ]
}

  1. We already have delete-marker as last version
$ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov
{
    "DeleteMarkers": [
        {
            "Owner": {
                "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
                "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
            },
            "Key": "obj",
            "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH",
            "IsLatest": true,
            "LastModified": "2023-04-11T09:47:50+00:00"
        }
    ]
}

$ aws s3api --endpoint http://localhost:8084 delete-object --bucket dkirillov --key obj
{
    "DeleteMarker": true,
    "VersionId": "FtVMc9v7oxQTc91Pyp8e1whF6roA6s1TxDfhe63Qd4oC"
}

$ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov
{
    "DeleteMarkers": [
        {
            "Owner": {
                "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
                "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
            },
            "Key": "obj",
            "VersionId": "FtVMc9v7oxQTc91Pyp8e1whF6roA6s1TxDfhe63Qd4oC",
            "IsLatest": true,
            "LastModified": "2023-04-11T09:52:21+00:00"
        },
        {
            "Owner": {
                "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM",
                "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM"
            },
            "Key": "obj",
            "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH",
            "IsLatest": false,
            "LastModified": "2023-04-11T09:47:50+00:00"
        }
    ]
}

We should check how AWS S3 behave in 1 case. And definitely fix 2 case.

/cc @alexvanin @ironbee

Currently, we create delete-marker (in bucket with versioning enabled) even if: 1. We have no object at all ``` $ aws s3api --endpoint http://localhost:8084 create-bucket --bucket dkirillov $ aws s3api --endpoint http://localhost:8084 put-bucket-versioning --bucket dkirillov --versioning-configuration Status=Enabled $ aws s3api --endpoint http://localhost:8084 get-bucket-versioning --bucket dkirillov { "Status": "Enabled" } $ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov $ aws s3api --endpoint http://localhost:8084 delete-object --bucket dkirillov --key obj { "DeleteMarker": true, "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH" } $ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov { "DeleteMarkers": [ { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "obj", "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH", "IsLatest": true, "LastModified": "2023-04-11T09:47:50+00:00" } ] } ``` 2. We already have delete-marker as last version ``` $ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov { "DeleteMarkers": [ { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "obj", "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH", "IsLatest": true, "LastModified": "2023-04-11T09:47:50+00:00" } ] } $ aws s3api --endpoint http://localhost:8084 delete-object --bucket dkirillov --key obj { "DeleteMarker": true, "VersionId": "FtVMc9v7oxQTc91Pyp8e1whF6roA6s1TxDfhe63Qd4oC" } $ aws s3api --endpoint http://localhost:8084 list-object-versions --bucket dkirillov { "DeleteMarkers": [ { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "obj", "VersionId": "FtVMc9v7oxQTc91Pyp8e1whF6roA6s1TxDfhe63Qd4oC", "IsLatest": true, "LastModified": "2023-04-11T09:52:21+00:00" }, { "Owner": { "DisplayName": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM", "ID": "NbUgTSFvPmsRxmGeWpuuGeJUoRoi6PErcM" }, "Key": "obj", "VersionId": "CZHQtg32tvDA3kQ7jCDzk1xonkDmXdED8a5uuSRr99WH", "IsLatest": false, "LastModified": "2023-04-11T09:47:50+00:00" } ] } ``` We should check how AWS S3 behave in 1 case. And definitely fix 2 case. /cc @alexvanin @ironbee
Owner

For the record, minio:

  1. does not create delete marker on non-existing object,
  2. does not add extra delete marker if latest version is already delete marker.
For the record, minio: 1. does not create delete marker on non-existing object, 2. does not add extra delete marker if latest version is already delete marker.
dkirillov was assigned by alexvanin 2023-04-12 14:18:35 +00:00
alexvanin added this to the v0.27.0 milestone 2023-04-12 14:18:38 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 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#83
No description provided.