Unable to delete a SLO due to a fixed value of MAX_BUFFERED_SLO_SEGMENTS

Bug #1746685 reported by Charles Hsu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Medium
Samuel Merritt

Bug Description

SLO middleware allows admin to change `max_manifest_segments` (default is 10000), but we do have another setting in constraints called `MAX_BUFFERED_SLO_SEGMENTS` (default is 10000) that use for a SLO DELETE request. The value is hard code, admin can't change it.

Imagine the use case, when admin increase the `max_manifest_segments` to 50000, that means users can upload SLO have > 10000 segments without any issue. But users won't able to delete it due to `MAX_BUFFERED_SLO_SEGMENTS`. And you will see the error in below,

DEBUG:requests.packages.urllib3.connectionpool:http://192.168.190.21:80 "DELETE /v1/AUTH_demo/test/test.img?multipart-manifest=delete HTTP/1.1" 200 None
DEBUG:swiftclient:REQ: curl -i http://192.168.190.21/v1/AUTH_demo/test/test.img?multipart-manifest=delete DELETE -H "X-Auth-Token: AUTH_<SKIP>"
DEBUG:swiftclient:RESP STATUS: 200 OK
DEBUG:swiftclient:RESP HEADERS: {u'Date': u'Thu, 01 Feb 2018 05:44:25 GMT', u'Transfer-Encoding': u'chunked', u'Content-Type': u'text/plain', u'X-Openstack-Request-Id': u'tx04a88f6de6804ca9aa8a9-005a72a939', u'X-Trans-Id': u'tx04a88f6de6804ca9aa8a9-005a72a939'}
DEBUG:swiftclient:RESP BODY: Number Deleted: 0
Number Not Found: 0
Response Body: Too many buffered slo segments to delete.
Response Status: 400 Bad Request

https://github.com/openstack/swift/blob/master/swift/common/middleware/slo.py#L1182-L1184

Revision history for this message
Samuel Merritt (torgomatic) wrote :

I'm inclined to set SLO's bulk-deleter's max_deletes_per_request to a big number. Not equal to SLO's max_manifest_segments, but something big enough that, even if your current max_manifest_segments is less than its historic high, your users can still delete any SLO manifest that they have.

Changed in swift:
assignee: nobody → Samuel Merritt (torgomatic)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/540122

Changed in swift:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.opendev.org/540122
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=cb308119160d5af7db9b65a7ab2225bb07edb614
Submitter: Zuul
Branch: master

commit cb308119160d5af7db9b65a7ab2225bb07edb614
Author: Samuel Merritt <email address hidden>
Date: Thu Feb 1 12:03:49 2018 -0800

    Allow bulk delete of big SLO manifests

    If you set SLO's max_manifest_segments to a value larger than 10000,
    then clients are able to create manifests with that many segments, but
    unable to use "?multipart-manifest=delete" to delete them.

    This is because the SLO middleware has its very own bulk-deleter that
    it uses to handle such requests, and that bulk-deleter only allows
    10000 deletions per request by default. This commit removes the
    limitation so that any SLO manifest can be deleted along with its
    segments.

    I considered setting max-deletes-per-request to be equal to SLO's
    max_manifest_segments, but that only works if max_manifest_segments
    has never been decreased.

    Note that this commit does not increase max_manifest_segments. Clients
    cannot make SLOs any bigger than they could before. Also note that
    this commit does not affect user-initiated bulk deletes, i.e. POST
    requests with "?bulk-delete=true" set. Those requests are still
    limited in their size, and those limits are not changed.

    Change-Id: I6a35937e8418f4f2b8e29825fc9c40415e34742f
    Closes-Bug: 1746685

Changed in swift:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/losf)

Fix proposed to branch: feature/losf
Review: https://review.opendev.org/677848

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (feature/losf)
Download full text (20.8 KiB)

Reviewed: https://review.opendev.org/677848
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=6204a2bc571a51e91f97ad4342b8ae216aaf6f36
Submitter: Zuul
Branch: feature/losf

commit ff5ea003b3a1b37d8417aa17d3521237768dfe62
Author: Tim Burke <email address hidden>
Date: Tue Aug 20 22:20:44 2019 -0700

    ec: log durability of frags that fail to reconstruct

    Whether the frag is durable or non-durable greatly affects how much I
    care whether I can reconstruct it.

    Change-Id: Ie6f46267d4bb567ecc0cc195d1fd7ce55c8cb325

commit 94366fd00ec1e71b4f67ef8595b31162c6945c28
Author: Thiago da Silva <email address hidden>
Date: Mon Aug 19 22:31:41 2019 +0200

    Add Dockerfile to build a py3 swift docker image

    This patch contains only a new Dockerfile and few changes to
    be able to build both py2 and py3 images.

    Next patch should contain changes to add the gate jobs to build
    a py3 docker image

    Change-Id: Ifdebde9597a787abcd553756e22261e2faaeedfc

commit e92191306587335ad0aab3a3b9dffef21765e17b
Author: Clay Gerrard <email address hidden>
Date: Mon Aug 19 11:06:20 2019 -0500

    Rename symlink method

    Related-Change-Id: I179ea6180d31146bb947061c69b1807c59529ac8
    Change-Id: I770ea1be25e339e5ce4341b532a1fff9e1373152

commit 82e427a8b14e3efee2da99d622fad04ed6461a50
Author: Clay Gerrard <email address hidden>
Date: Mon Aug 19 10:56:50 2019 -0500

    Fix symlink docstring

    Related-Change-Id: I179ea6180d31146bb947061c69b1807c59529ac8
    Change-Id: I41cbf445057be09a102ef5515a9ce6a4f14e7458

commit a21c0be70ca6c200076d274c54f6906e1cf92a61
Author: Tim Burke <email address hidden>
Date: Wed Jun 5 12:02:07 2019 -0700

    dlo: Respond 200 on multi-range GETs

    We already had a unit test for this, but it was inadvertently retesting
    what test_get_suffix_range_many_segments tested.

    Change-Id: I43eee7029ca884268c3f2ad74300b94b299fd8d2
    Closes-Bug: #1831790

commit 7f42309a335370f567aefdf0236cfe01cbbfca5d
Author: Tim Burke <email address hidden>
Date: Thu Mar 21 15:13:36 2019 -0700

    py3: Cover account/container func tests

    Change-Id: I9a754f1eb06debbe16800a05fc8e969af2f89043

commit 3e7752d8c80473e93d537c7ba30419ff9313ebb8
Author: Thiago da Silva <email address hidden>
Date: Fri Aug 16 18:30:13 2019 +0200

    Update docker image to latest Alpine 3.10.1

    Change-Id: I888c51a965ee27175584f575560a1d50f4534663

commit 1abc9c4f9d4c2f9d8ac996cca489b0ec65660a05
Author: Tim Burke <email address hidden>
Date: Thu Jan 24 00:23:01 2019 +0000

    Allow "static symlinks"

    ... by embedding something like `If-Match: <etag>` semantics in the
    symlink.

    When creating a symlink, users may now specify an optional
    X-Symlink-Target-Etag header. If present, the etag of the final object
    returned to the client will be checked; if it does not match the
    X-Symlink-Target-Etag header, a 409 Conflict error will be returned to
    the client.

    Note that, unlike "dynamic symlink" behavior, the target object must
    exist with the matching Etag for the "static symlink" to be created.

    Since we're v...

tags: added: in-feature-losf
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.23.0

This issue was fixed in the openstack/swift 2.23.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.