]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: purge the object from the cache when proxying and not promoting the op
authorZhiqiang Wang <zhiqiang.wang@intel.com>
Tue, 2 Jun 2015 08:36:56 +0000 (16:36 +0800)
committerSamuel Just <sjust@redhat.com>
Tue, 18 Aug 2015 18:25:24 +0000 (11:25 -0700)
When proxying the write/cache op, if it is decided to not promote the
object, need to purge it from the object_contexts cache. Otherwise, it
causes problems for the later ops on this object.

Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
src/osd/ReplicatedPG.cc

index 96f0994eb8522a2734f74098c49db5e9ecd48fa9..224454a8ab4b2546b5c51be34308e046589a9218 100644 (file)
@@ -1863,10 +1863,15 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
       }
 
       // Promote too?
+      bool promoting = false;
       if (!op->need_skip_promote()) {
-        maybe_promote(obc, missing_oid, oloc, in_hit_set,
-                     pool.info.min_write_recency_for_promote,
-                     OpRequestRef());
+        promoting = maybe_promote(obc, missing_oid, oloc, in_hit_set,
+                                  pool.info.min_write_recency_for_promote,
+                                  OpRequestRef());
+      }
+      // purge the object in the cache if not promoting
+      if (!promoting) {
+       object_contexts.purge(obc->obs.oi.soid);
       }
     } else {
       if (can_proxy_read)