swift/test/unit/common/middleware
Alistair Coles fa7d80029b Make container update override headers persistent
Whatever container update override etag is sent to the object server
with a PUT must be used in container updates for subsequent
POSTs. Unfortunately the current container update override headers
(x-backend-container-update-override-*) are not persisted with the
object metadata so are not available when handling a POST.

For EC there is an ugly hack in the object server to use the
x-object-sysmeta-ec-[etag,size] values when doing a container update
for a POST.

With crypto, the encryption middleware needs to override the etag
(possibly overriding the already overridden EC etag value) with an
encrypted etag value. We therefore have a similar problem that this
override value is not persisted at the object server.

This patch introduces a new namespace for container override headers,
x-object-sysmeta-container-update-override-*, which uses object
sysmeta so that override values are persisted. This allows a general
mechanism in the object server to apply the override values (if any
have been set) from object sysmeta when constructing a container
update for a PUT or a POST. Middleware should use the
x-object-sysmeta-container-update-override-* namespace when setting
container update overrides. Middleware should be aware that other
middleware may have already set container override headers, in which
case consideration should be given to whether any existing value should
take precedence.

For backwards compatibility the existing
x-backend-container-update-override-* style headers are still
supported in the object server for EC override values, and the ugly
hack for EC etag/size override in POST updates remains in the object
server. That allows an older proxy server to be used with an upgraded
object server. The proxy server continues to use the
x-backend-container-update-override-* style headers for EC values so
that an older object server will continue to work with an upgraded
proxy server.

x-object-sysmeta-container-update-override-* headers take precedence
over x-backend-container-update-override-* headers and the use of
x-backend-container-update-override-* headers by middleware is
deprecated.  Existing third party middleware that is using
x-backend-container-update-override-* headers should be modified to
use x-object-sysmeta-container-update-override-* headers in order to
be compatible with other middleware such as encryption and to ensure
that container updates during POST requests carry correct values. If
targeting multiple versions of Swift object servers it may be
necessary to send headers from both namespaces. However, in general it
is recommended to upgrade all backend servers, then upgrade proxy
servers before finally upgrading third party middleware.

Co-Authored-By: Tim Burke <tim.burke@gmail.com>

UpgradeImpact

Change-Id: Ib80b4db57dfc2d37ea8ed3745084a3981d082784
2016-06-22 14:48:39 +01:00
..
__init__.py Initial commit of middleware refactor 2010-08-20 00:42:38 +00:00
helpers.py Make container update override headers persistent 2016-06-22 14:48:39 +01:00
test_account_quotas.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_acl.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_bulk.py Allow concurrent bulk deletes 2016-05-23 21:38:45 -07:00
test_cname_lookup.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_container_sync.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_copy.py Make container update override headers persistent 2016-06-22 14:48:39 +01:00
test_crossdomain.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_dlo.py Refactor server side copy as middleware 2016-05-11 14:55:51 -04:00
test_domain_remap.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_except.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_formpost.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_gatekeeper.py By default, disallow inbound X-Timestamp headers 2016-03-09 09:14:46 +00:00
test_healthcheck.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_keystoneauth.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_list_endpoints.py change default ports for servers 2016-04-29 14:47:38 -04:00
test_memcache.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_name_check.py pep8 fix: assertEquals -> assertEqual 2015-10-11 12:57:25 +02:00
test_proxy_logging.py Refactor tests and add tests 2016-06-15 16:36:25 +01:00
test_quotas.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_ratelimit.py Use the same key for memcache and env['swift.infocache'] 2016-05-16 18:43:32 -07:00
test_recon.py change default ports for servers 2016-04-29 14:47:38 -04:00
test_slo.py Merge "Fix setup of manifest responses in SLO tests" 2016-05-25 08:43:31 +00:00
test_staticweb.py Stop staticweb revealing container existence to unauth'd requests 2016-02-25 08:52:05 +00:00
test_tempauth.py Replace assertEqual(None, *) with assertIsNone in tests 2016-02-16 23:49:06 +08:00
test_tempurl.py Merge "Add Expires header for successful GETs using tempurls" 2016-06-04 06:16:41 +00:00
test_versioned_writes.py Refactor server side copy as middleware 2016-05-11 14:55:51 -04:00
test_xprofile.py clear pycache and remove all pyc/pyo before starting unit test 2016-03-04 17:32:12 +00:00