dlo / slo do not handle If-Match/If-None-Match headers correctly

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

Bug Description

When performing a GET on a dynamic/static large object, if one of the following headers is provided, the user will experience inconsistent behavior with non dynamic/static large objects.

"If-Match: <object etag>" - Causes a HTTP 412 instead of HTTP 200
"If-None-Match: <object etag>" - Causes a 200 instead of HTTP 304

Changed in swift:
status: New → Confirmed
assignee: nobody → Samuel Merritt (torgomatic)
Revision history for this message
Samuel Merritt (torgomatic) wrote :

Is this a regression with the moved SLO/DLO stuff, or did this never work?

Revision history for this message
David Goetz (david-goetz) wrote :

Pretty sure it never worked

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

Okay then. I'll still fix it, but that drops it from "oh crap fix it NOW" to "yeah, that should get fixed pretty soon".

Changed in swift:
importance: Undecided → Medium
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/73162

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.openstack.org/73162
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=1f67eb7403e6000840c44ec702c406f177ea1942
Submitter: Jenkins
Branch: master

commit 1f67eb7403e6000840c44ec702c406f177ea1942
Author: Samuel Merritt <email address hidden>
Date: Wed Feb 12 18:29:12 2014 -0800

    Support If-[None-]Match for object HEAD, SLO, and DLO

    I moved the checking of If-Match and If-None-Match out of the object
    server's GET method and into swob so that everyone can use it. The
    interface is similar to the Range handling; make a response with
    conditional_response=True, and you get handing of If-Match and
    If-None-Match.

    Since the only users of conditional_response are object GET, object
    HEAD, SLO, and DLO, this has the effect of adding support for If-Match
    and If-None-Match to just the latter three places and nowhere
    else. This makes object GET and HEAD consistent for any kind of
    object, large or small.

    This also fixes a bug where various conditional headers (If-*) were
    passed through to the object server on segment requests, which could
    cause segment requests to fail with a 304 or 412 response. Now only
    certain headers are copied to the segment requests, and that doesn't
    include the conditional ones, so they can't goof up the segment
    retrieval.

    Note that I moved SegmentedIterable to swift.common.request_helpers
    because it sprouted a transitive dependency on swob, and leaving it in
    utils caused a circular import.

    Bonus fix: unified the handling of DiskFileQuarantined and
    DiskFileNotFound in object server GET and HEAD. Now in either case, a
    412 will be returned if the client said "If-Match: *". If not, the
    response is a 404, just like before.

    Closes-Bug: 1279076
    Closes-Bug: 1280022
    Closes-Bug: 1280028

    Change-Id: Id2ee78346244d516b980202e990aa38ce6812de5

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.13.0
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (feature/ec)

Fix proposed to branch: feature/ec
Review: https://review.openstack.org/77244

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

Reviewed: https://review.openstack.org/77244
Committed: https://git.openstack.org/cgit/openstack/swift/commit/?id=2c22fb0a17e1192b95d0b823dfce144779579944
Submitter: Jenkins
Branch: feature/ec

commit dc5c5fb4011cc8dee9b149e668dc8534ac7f51e0
Author: Hou Ming Wang <email address hidden>
Date: Wed Feb 26 20:53:10 2014 +0800

    Remove blank space after print

    Check Swift code, remove blank space after print.

    Change-Id: Ia7838ac5f33f2b335d1cd664b017e87118262d29

commit b6eda4a40bd55771771ca8039e9c3ad39ff7de11
Author: John Dickinson <email address hidden>
Date: Sun Feb 23 15:24:47 2014 -0800

    AUTHORS and CHANGELOG update for 1.13 release

    Change-Id: I6195c70cbbd7c94682539962dd5410e3665f01ac

commit 3357a58ea2a8fc35e6672c52028e59fbafe7fcb7
Author: Matt Kassawara <email address hidden>
Date: Thu Feb 20 20:27:20 2014 -0700

    Alphabetized items under "Middleware" in source documentation

    I alphabetized the items under "Middleware" in the source documentation
    to make them easier to locate.

    Change-Id: I3a0108c89d16ef07b7623dda518b3096c2686002

commit beaa2b8744841acac5af1a2171a358f58d7288be
Author: John Dickinson <email address hidden>
Date: Sun Feb 23 10:22:34 2014 -0800

    tabs to spaces

    Change-Id: Ie3d3af87df8f72792abf345c0d4dcfe2be1f4141

commit f42cb54002eaaa1f82a7a489802afc85412e2ce1
Author: Samuel Merritt <email address hidden>
Date: Fri Feb 21 16:49:22 2014 -0800

    Refactor a quorum-size calculation

    No behavior change, just use the utility function instead of rolling
    our own.

    Change-Id: I152ccd8f22f424cd7547fa4d67df020f263096a9

commit 5dfa0bd3fba6fe414f7a6ed9d7d19f9dea25445e
Author: Matt Kassawara <email address hidden>
Date: Fri Feb 21 10:59:29 2014 -0700

    Alphabetized items under other sections in source documentation

    I alphabetized the items under "Proxy", "Account", "Container",
    and "Object" in the source documentation to make them easier to
    locate.

    Change-Id: Ia9cca0ee558cb1e0361c1a88103352bd006da1e3

commit 38e015e871add82889d1e7999b35b795f4a7d1f5
Author: Samuel Merritt <email address hidden>
Date: Thu Feb 20 23:01:00 2014 -0800

    Functional tests for DLO If-Match/If-None-Match

    Change-Id: I4a731a3836eb0f58b897ee43477b3b76d2344a81

commit 46250171ef285b0d297b05f413f1a27ff1dbdb65
Author: Samuel Merritt <email address hidden>
Date: Thu Feb 20 22:01:39 2014 -0800

    Functional tests for SLO If-Match/If-None-Match

    Change-Id: Ib70f579f5edebc7b1586e5f51fee5769bcaa9931

commit 25ebf3aa9e6e98974565ae1b70fc05b49423e17c
Author: Samuel Merritt <email address hidden>
Date: Thu Feb 20 20:33:00 2014 -0800

    Raise error on long or short DLO

    The GET response for a DLO has a Content-Length that's computed from
    the container listing, but the response body's length is determined by
    the segments. If a segment grows or shrinks between when the headers
    are sent and when the segment is requested, this confuses clients.

    For example, if the DLO is longer than its Content-Length and the
    client sends another request on the same TCP connection, then it can
    get leftover object bytes instea...

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.