]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
When a system object is created exclusively, do not distribute the 20107/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 6 Dec 2017 21:36:28 +0000 (16:36 -0500)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Wed, 24 Jan 2018 21:51:38 +0000 (13:51 -0800)
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 <ivancich@redhat.com>
(cherry picked from commit 647ce3387312fc683660c1f3c7571c577379be1c)
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
src/rgw/rgw_cache.h

index 760a7e25ff0b2451cb94a64df6dc673b2cd754cb..022dc3624ff178e3a5c0388fce77d509213d19fc 100644 (file)
@@ -420,9 +420,18 @@ int RGWCache<T>::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);
   }