diff options
author | Jianjian Huo <jhuo@nvidia.com> | 2023-03-08 15:45:26 -0800 |
---|---|---|
committer | Jianjian Huo <jhuo@nvidia.com> | 2023-04-17 09:49:26 -0700 |
commit | 71d507f8e17295fac1a97c8aab3883e042665fc4 (patch) | |
tree | bad74dd24e1c7f713edac3a8642c47a16fd62c48 /swift/proxy/controllers/obj.py | |
parent | 2e89e92cb77bd5341a1a290bdfc9402b02f71ab6 (diff) | |
download | swift-71d507f8e17295fac1a97c8aab3883e042665fc4.tar.gz |
Proxy: restructure cached listing shard ranges
Updating shard range cache has been restructured and upgraded to v2
which only persist the essential attributes in memcache (see
Related-Change). This is the following patch to restructure the
listing shard ranges cache for object listing in the same way.
UpgradeImpact
=============
The cache key for listing shard ranges in memcached is renamed
from 'shard-listing/<account>/<container>' to
'shard-listing-v2/<account>/<container>', and cache data is
changed to be a list of [lower bound, name]. As a result, this
will invalidate all existing listing shard ranges stored in the
memcache cluster.
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Related-Change: If98af569f99aa1ac79b9485ce9028fdd8d22576b
Change-Id: I54a32fd16e3d02b00c18b769c6f675bae3ba8e01
Diffstat (limited to 'swift/proxy/controllers/obj.py')
-rw-r--r-- | swift/proxy/controllers/obj.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/swift/proxy/controllers/obj.py b/swift/proxy/controllers/obj.py index b69631538..e9f797ddf 100644 --- a/swift/proxy/controllers/obj.py +++ b/swift/proxy/controllers/obj.py @@ -48,7 +48,7 @@ from swift.common.utils import ( normalize_delete_at_timestamp, public, get_expirer_container, document_iters_to_http_response_body, parse_content_range, quorum_size, reiterate, close_if_possible, safe_json_loads, md5, - ShardRange, find_shard_range, cache_from_env, NamespaceBoundList) + ShardRange, find_namespace, cache_from_env, NamespaceBoundList) from swift.common.bufferedhttp import http_connect from swift.common.constraints import check_metadata, check_object_creation from swift.common import constraints @@ -388,7 +388,7 @@ class BaseObjectController(Controller): memcache.set( cache_key, cached_namespaces.bounds, time=self.app.recheck_updating_shard_ranges) - update_shard = find_shard_range(obj, shard_ranges or []) + update_shard = find_namespace(obj, shard_ranges or []) record_cache_op_metrics( self.logger, 'shard_updating', cache_state, response) return update_shard |