From eaa45f8b79b560e511584e962d5a48ca9a7c2ba0 Mon Sep 17 00:00:00 2001 From: "Florent Vennetier (OpenIO)" Date: Wed, 14 Aug 2019 14:44:56 +0200 Subject: [PATCH] CH: don't warn when deleting missing placeholder --- .../common/middleware/container_hierarchy.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/oioswift/common/middleware/container_hierarchy.py b/oioswift/common/middleware/container_hierarchy.py index 39ec836a..1a1e4cf6 100644 --- a/oioswift/common/middleware/container_hierarchy.py +++ b/oioswift/common/middleware/container_hierarchy.py @@ -461,7 +461,8 @@ def _remove_placeholder(self, req, account, container, mode, path): if self.redis_keys_format == REDIS_KEYS_FORMAT_V1: res = self.conn.delete(key) if not res: - LOG.warn("%s: failed to remove key %s", self.SWIFT_SOURCE, key) + LOG.debug("%s: _remove_placeholder: %s did not exist", + self.SWIFT_SOURCE, key) else: path += "/" if self.redis_keys_format == REDIS_KEYS_FORMAT_V2: @@ -469,8 +470,8 @@ def _remove_placeholder(self, req, account, container, mode, path): else: res = self.conn.zdel(key, path) if not res: - LOG.warn("%s: failed to remove path %s key %s", - self.SWIFT_SOURCE, path, key) + LOG.debug("%s: _remove_placeholder: %s was not in %s", + self.SWIFT_SOURCE, path, key) def _build_object_listing_mpu(self, start_response, env, account, container, prefix, @@ -845,6 +846,11 @@ def should_bypass(self, env): super(ContainerHierarchyMiddleware, self).should_bypass(env)) def update_copy_headers(self, req, env2): + """ + When the requested operation is a server-side copy, rewrite the + header telling where is the source to make it point to the proper + shard. + """ if 'Oio-Copy-From' in req.headers and req.method == 'PUT': # TODO(mb): check if MPU is used here (with upload-part-copy) _, c_container, c_obj = req.headers['Oio-Copy-From'].split('/', 2) @@ -951,7 +957,7 @@ def __call__(self, env, start_response): account, container, path) # HEAD dir1/dir2 : this case is partially managed by checking - # is # Redis Key CNT exists for dir1, if key if not present, we + # if a container key exists for dir1: if key is not present, we # can reply 404 because there is no objects in dir1/ container if not is_mpu and req.method in ('GET', 'HEAD'): key = self.key(account, container, CNT, path) @@ -983,7 +989,7 @@ def __call__(self, env, start_response): recursive=must_recurse, is_mpu=is_mpu) else: - # should be other operation that listing + # should be another operation than listing if obj: env2['PATH_INFO'] = "/v1/%s/%s/%s" % (account, container2, obj2)