From: J. Eric Ivancich Date: Wed, 6 Dec 2017 21:36:28 +0000 (-0500) Subject: When a system object is created exclusively, do not distribute the X-Git-Tag: v12.2.3~140^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b219b854b708c532bacb37ee8c8253c80586fef6;p=ceph.git When a system object is created exclusively, do not distribute the cache information to the other rados gateways and instead let them lazily retrieve the information when they need it. Signed-off-by: J. Eric Ivancich (cherry picked from commit 647ce3387312fc683660c1f3c7571c577379be1c) Signed-off-by: Robin H. Johnson --- diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index 760a7e25ff0b..022dc3624ff1 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -420,9 +420,18 @@ int RGWCache::put_system_obj_impl(rgw_raw_obj& obj, uint64_t size, real_time string name = normal_name(pool, oid); if (ret >= 0) { cache.put(name, info, NULL); - int r = distribute_cache(name, obj, info, UPDATE_OBJ); - if (r < 0) - mydout(0) << "ERROR: failed to distribute cache for " << obj << dendl; + // Only distribute the cache information if we did not just create + // the object with the exclusive flag. Note: PUT_OBJ_EXCL implies + // PUT_OBJ_CREATE. Generally speaking, when successfully creating + // a system object with the exclusive flag it is not necessary to + // call distribute_cache, as a) it's unclear whether other RGWs + // will need that system object in the near-term and b) it + // generates additional network traffic. + if (!(flags & PUT_OBJ_EXCL)) { + int r = distribute_cache(name, obj, info, UPDATE_OBJ); + if (r < 0) + mydout(0) << "ERROR: failed to distribute cache for " << obj << dendl; + } } else { cache.remove(name); }