]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: consider IGNORE_CACHE for all maybe_handle_cache calls 6181/head
authorSamuel Just <sjust@redhat.com>
Thu, 1 Oct 2015 19:11:18 +0000 (12:11 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 1 Oct 2015 21:11:00 +0000 (14:11 -0700)
Otherwise, we could erroneously promote a snap after not promoting
the missing head for which we have a cached obc and ssc.

Fixes: #13323
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index 857ed09b38af65f974020ab0e34c2d2a325dc60b..ea616f0aefb8987bc191c3d5525b5d973bb8185d 100644 (file)
@@ -1702,8 +1702,13 @@ void ReplicatedPG::do_op(OpRequestRef& op)
       return;
   }
 
-  if (!(m->has_flag(CEPH_OSD_FLAG_IGNORE_CACHE)) &&
-      maybe_handle_cache(op, write_ordered, obc, r, missing_oid, false, in_hit_set))
+  if (maybe_handle_cache(op,
+                        write_ordered,
+                        obc,
+                        r,
+                        missing_oid,
+                        false,
+                        in_hit_set))
     return;
 
   if (r && (r != -ENOENT || !obc)) {
@@ -1939,6 +1944,14 @@ bool ReplicatedPG::maybe_handle_cache(OpRequestRef op,
                                      bool must_promote,
                                      bool in_hit_set)
 {
+  if (op &&
+      op->get_req() &&
+      op->get_req()->get_type() == CEPH_MSG_OSD_OP &&
+      (static_cast<MOSDOp *>(op->get_req())->get_flags() &
+       CEPH_OSD_FLAG_IGNORE_CACHE)) {
+    dout(20) << __func__ << ": ignoring cache due to flag" << dendl;
+    return false;
+  }
   // return quickly if caching is not enabled
   if (pool.info.cache_mode == pg_pool_t::CACHEMODE_NONE)
     return false;