swift/test/unit/container
Matthew Oliver 03b66c94f4 Proxy: Use namespaces when getting listing/updating shards
With the Related-Change, container servers can return a list Namespace
objects in response to a GET request.  This patch modifies the proxy
to take advantage of this when fetching namespaces. Specifically,
the proxy only needs Namespaces when caching 'updating' or 'listing'
shard range metadata.

In order to allow upgrades to clusters we can't just send
'X-Backend-Record-Type = namespace', as old container servers won't
know how to respond. Instead, proxies send a new header
'X-Backend-Record-Shard-Format = namespace' along with the existing
'X-Backend-Record-Type = shard' header. Newer container servers will
return namespaces, old container servers continue to return full
shard ranges and they are parsed as Namespaces by the new proxy.

This patch refactors _get_from_shards to clarify that it does not
require ShardRange objects. The method is now passed a list of
namespaces, which is parsed from the response body before the method
is called. Some unit tests are also refactored to be more realistic
when mocking _get_from_shards.

Also refactor the test_container tests to better test shard-range and
namespace responses from legacy and modern container servers.

Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Co-Authored-By: Jianjian Huo <jhuo@nvidia.com>
Related-Change: If152942c168d127de13e11e8da00a5760de5ae0d
Change-Id: I7169fb767525753554a40e28b8c8c2e265d08ecd
2024-01-11 10:46:53 +00:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
test_auditor.py Cleanup tests' import of debug_logger 2021-04-27 12:04:41 +01:00
test_backend.py Container-server: add container namespaces GET 2024-01-11 10:46:53 +00:00
test_reconciler.py Get rid of pipeline_property 2022-01-27 14:40:27 -08:00
test_replicator.py Add FakeStatsdClient to unit tests 2023-08-07 10:10:45 +01:00
test_server.py Container-server: add container namespaces GET 2024-01-11 10:46:53 +00:00
test_sharder.py Proxy: Use namespaces when getting listing/updating shards 2024-01-11 10:46:53 +00:00
test_sync_store.py Cleanup tests' import of debug_logger 2021-04-27 12:04:41 +01:00
test_sync.py Modify log_name in internal clients' pipeline configs 2022-01-12 11:07:25 +00:00
test_updater.py updaters: use replication network 2021-12-10 13:31:45 +00:00