SLO can erroneously respond with 416

Bug #1837270 reported by Tim Burke
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Medium
Tim Burke

Bug Description

When the client does a ranged request or conditional request for an SLO, the first response from the object server likely isn't the correct one. As a result, SLO may need to go refetch the manifest to determine the correct response [1].

However, this second read may not match the first, for a variety of reasons:

- The initial response may have had stale data and the subsequent one newer, in which case we ought to act on the newer data (or tombstone).
- The initial response may have been new but the subsequent one stale; 503 seems best.
- The initial response may have been good but the subsequent one failed, either returning 404 from a handoff or 503 after running out of handoffs; 503 is appropriate.

Instead, currently, we never check the GET response [2], so we try to interpret whatever we got as JSON [3]. This likely fails, leading us to think the manifest is empty (!?). As a result, a ranged request (for example) will 416.

[1] https://github.com/openstack/swift/blob/2.21.0/swift/common/middleware/slo.py#L687-L730
[2] https://github.com/openstack/swift/blob/2.21.0/swift/common/middleware/slo.py#L812-L821
[3] https://github.com/openstack/swift/blob/2.21.0/swift/common/middleware/slo.py#L866-L874

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.opendev.org/671882

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/671882
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=ef5a37c2bf5a32b0fa6404974aa76332a88c0841
Submitter: Zuul
Branch: master

commit ef5a37c2bf5a32b0fa6404974aa76332a88c0841
Author: Tim Burke <email address hidden>
Date: Fri Jul 19 21:24:47 2019 -0700

    slo: Better handle non-manifest responses when refetching manifest

    Previously, we never checked whether the response we get when refetching
    is even successful, much less whether it's still coming from an SLO.

    Now, if the refetched data is newer, act on it. If it's older, 503.

    Closes-Bug: #1837270
    Change-Id: I106b94c77da220c762869aa800c31b87c3dffeeb

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.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/689580

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (stable/stein)

Reviewed: https://review.opendev.org/689580
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=f353b78b92ad7a3f15aa6b21d1f8be592e8ca212
Submitter: Zuul
Branch: stable/stein

commit f353b78b92ad7a3f15aa6b21d1f8be592e8ca212
Author: Tim Burke <email address hidden>
Date: Fri Jul 19 21:24:47 2019 -0700

    slo: Better handle non-manifest responses when refetching manifest

    Previously, we never checked whether the response we get when refetching
    is even successful, much less whether it's still coming from an SLO.

    Now, if the refetched data is newer, act on it. If it's older, 503.

    Closes-Bug: #1837270
    Change-Id: I106b94c77da220c762869aa800c31b87c3dffeeb
    (cherry picked from commit ef5a37c2bf5a32b0fa6404974aa76332a88c0841)

tags: added: in-stable-stein
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/690740

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (stable/rocky)

Reviewed: https://review.opendev.org/690740
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=187380e604dd1a4e533deae62de68a00dddb8661
Submitter: Zuul
Branch: stable/rocky

commit 187380e604dd1a4e533deae62de68a00dddb8661
Author: Tim Burke <email address hidden>
Date: Fri Jul 19 21:24:47 2019 -0700

    slo: Better handle non-manifest responses when refetching manifest

    Previously, we never checked whether the response we get when refetching
    is even successful, much less whether it's still coming from an SLO.

    Now, if the refetched data is newer, act on it. If it's older, 503.

    Closes-Bug: #1837270
    Change-Id: I106b94c77da220c762869aa800c31b87c3dffeeb
    (cherry picked from commit ef5a37c2bf5a32b0fa6404974aa76332a88c0841)
    (cherry picked from commit f353b78b92ad7a3f15aa6b21d1f8be592e8ca212)

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.19.2

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/swift 2.21.1

This issue was fixed in the openstack/swift 2.21.1 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.