if-modified-since: <last-modified> on SLO returns 304 on HEAD, but 500 on GET
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When making a well formated If-Modified-Since conditional header with GET on an SLO object (a reasonable use-case, that works with regular objects and DLO manifests see lp bug#1280022) - a client can reliably trigger a 500 Server Error:
# regular object
vagrant@saio:~$ swift stat -v test test
Auth Token: AUTH_tk37daf270
Content Type: application/
Content Length: 8
Last Modified: Mon, 23 Oct 2023 17:02:38 GMT
Meta Mtime: 1695270479.156160
X-Openstack-
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 304 Not Modified
Content-Type: application/
X-Object-
Etag: "70c1db56f301c9
Last-Modified: Mon, 23 Oct 2023 17:02:38 GMT
X-Timestamp: 1698080557.43293
Accept-Ranges: bytes
Content-Length: 0
X-Trans-Id: tx3c785d18b4a64
X-Openstack-
Date: Mon, 23 Oct 2023 17:05:43 GMT
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 304 Not Modified
Content-Type: application/
X-Object-
Etag: "70c1db56f301c9
Last-Modified: Mon, 23 Oct 2023 17:02:38 GMT
X-Timestamp: 1698080557.43293
Accept-Ranges: bytes
Content-Length: 0
X-Trans-Id: tx5429f8bfcb4e4
X-Openstack-
Date: Mon, 23 Oct 2023 17:05:49 GMT
# DLO manifest
vagrant@saio:~$ swift stat -v test test.dlo
Auth Token: AUTH_tk37daf270
Content Type: application/
Content Length: 10485760
Last Modified: Mon, 23 Oct 2023 17:03:49 GMT
Meta Mtime: 1698076626.622360
X-Openstack-
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 304 Not Modified
Content-Type: application/
X-Object-
X-Object-Manifest: test_segments/
Last-Modified: Mon, 23 Oct 2023 17:03:49 GMT
X-Timestamp: 1698080628.31794
Accept-Ranges: bytes
Content-Length: 0
Etag: "71e938d37c1d06
X-Trans-Id: txa7738e4a56564
X-Openstack-
Date: Mon, 23 Oct 2023 17:06:11 GMT
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 304 Not Modified
Content-Type: application/
X-Object-
X-Object-Manifest: test_segments/
Last-Modified: Mon, 23 Oct 2023 17:03:49 GMT
X-Timestamp: 1698080628.31794
Accept-Ranges: bytes
Content-Length: 0
Etag: "71e938d37c1d06
X-Trans-Id: tx3de8cf0047fb4
X-Openstack-
Date: Mon, 23 Oct 2023 17:06:14 GMT
# SLO Manifest
vagrant@saio:~$ swift stat -v test test.big
Auth Token: AUTH_tk37daf270
Content Type: application/
Content Length: 10485760
Last Modified: Mon, 23 Oct 2023 15:57:13 GMT
Meta Mtime: 1698076626.622360
X-Static-
X-Openstack-
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 304 Not Modified
Content-Type: application/
Content-Length: 0
X-Object-
X-Static-
Etag: "71e938d37c1d06
Last-Modified: Mon, 23 Oct 2023 15:57:13 GMT
X-Timestamp: 1698076632.97986
Accept-Ranges: bytes
X-Manifest-Etag: 89a14c33224fd28
X-Trans-Id: txc7cba1115c654
X-Openstack-
Date: Mon, 23 Oct 2023 17:06:47 GMT
vagrant@saio:~$ curl -H 'x-auth-token: AUTH_tk37daf270
HTTP/1.1 500 Internal Error
Content-Type: text/html; charset=UTF-8
Content-Length: 27
X-Trans-Id: txe40435f65c9a4
X-Openstack-
Date: Mon, 23 Oct 2023 17:06:51 GMT
N.B. SLO will return the expected 304 response, but only for HEADs
Unittesting suggests the server error can present with If-Unmodified-Since requests, as well as manifests stored w/o slo_etag/slo_size sysmeta.
summary: |
- if-modified-since: <last-modified> of SLO returns 304 on HEAD, but 500 + if-modified-since: <last-modified> on SLO returns 304 on HEAD, but 500 on GET |
Changed in swift: | |
status: | New → In Progress |
tags: | added: slo |
Reviewed: https:/ /review. opendev. org/c/openstack /swift/ +/896466 /opendev. org/openstack/ swift/commit/ 3dab88bdf83eba3 39cd1a2d391b9e4 21ff2c5cf0
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 3dab88bdf83eba3 39cd1a2d391b9e4 21ff2c5cf0
Author: Clay Gerrard <email address hidden>
Date: Fri Sep 22 14:48:41 2023 -0500
tests: refactor SLO size/etag sysmeta tests
We've been writing SLO manifests with size/etag sysmeta for more than 5
years, but we want our tests and code to continue to support the legacy
format forever. This test infra refactor will make that easier for test
authors to opt-in testing of legacy manifests by reusing a common
pattern for manifest setup across tests.
This consolidation also cleans up some duplication where two TestCases
had identical manifest setup and paves the way to more tidying of
similar (but slightly different) manifest setup across TestCases and
sharing of setup across future TestCases.
This manifest setup standardization also adopts a consistent naming
scheme for manifest sysmeta values so test assertions are easier to read
as correct at a glance (e.g. slo_etag vs json_md5)
Additionally leak tracking is added to the common base; SLO was already
really good about *closing* requests, but in many cases seems to not
bother reading/draining them (even when they might be empty/small).
As part of the leak tracking investigation a couple new tests were added
to explore the behavior of SLO's SegmentedIterable in the
request_helpers module.
Drive-By: Fix SegmentedIterable docstring: the constructor has
expected an iterable yielding dicts, not tuples, since the
Related-Change [2].
Drive-By: remove FakeSwift's now unused "register_ responses" interface next_response" as a replacment. This allows test responses" .
and provide "register_
authors to extend the registered response for a given request key from a
common test setup into a "series of registered responses" by expressing
just the new/next response rather than forcing them to duplicate the
initial response in the explicit list passed to "register_
Related-Bug: #2040178 5560b005cea750a a64a88c96f9 e6da7d6b819af79 582b671d699 6b755ec19cc9315 d06a6ca8b15
Co-Authored-By: Alistair Coles <email address hidden>
[1] Related-Change: Ia6ad3235410551
[2] Related-Change-Id: Ib8dc216a84d370
Change-Id: I54094f3d2098f5