03b66c94f4
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 |
||
---|---|---|
.. | ||
__init__.py | ||
test_auditor.py | ||
test_backend.py | ||
test_reconciler.py | ||
test_replicator.py | ||
test_server.py | ||
test_sharder.py | ||
test_sync_store.py | ||
test_sync.py | ||
test_updater.py |