]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librados, osd: add IGNORE_OVERLAY flag
authorSage Weil <sage@inktank.com>
Wed, 23 Oct 2013 01:44:03 +0000 (18:44 -0700)
committerSage Weil <sage@inktank.com>
Sat, 14 Dec 2013 00:35:54 +0000 (16:35 -0800)
Add a flag that will make the OSD bypass the cache overlay logic.  This is
needed in order to handle operations like CACHE_EVICT and CACHE_FLUSH.

Signed-off-by: Sage Weil <sage@inktank.com>
src/include/rados.h
src/include/rados/librados.hpp
src/librados/librados.cc
src/messages/MOSDOp.h
src/osd/ReplicatedPG.cc

index 2ab293daa689cd29ac34c13cf05cb01bf5ef6c31..484f221751655362df36337f48ffdfba7d31e19d 100644 (file)
@@ -346,6 +346,7 @@ enum {
        CEPH_OSD_FLAG_EXEC_PUBLIC =    0x1000,  /* DEPRECATED op may exec (public) */
        CEPH_OSD_FLAG_LOCALIZE_READS = 0x2000,  /* read from nearby replica, if any */
        CEPH_OSD_FLAG_RWORDERED =      0x4000,  /* order wrt concurrent reads */
+       CEPH_OSD_FLAG_IGNORE_OVERLAY = 0x8000,  /* ignore pool overlay */
 };
 
 enum {
index e66ef224f2ef82f99a8845590c6e077bb0fbc554..7e7f069ff2f4ef26f8d7217c35dfdac2a40dcfa5 100644 (file)
@@ -141,12 +141,17 @@ namespace librados
    * ORDER_READS_WRITES will order reads the same way writes are
    * ordered (e.g., waiting for degraded objects).  In particular, it
    * will make a write followed by a read sequence be preserved.
+   *
+   * IGNORE_OVERLAY will ignore the pool overlay tiering metadata and
+   * process the op directly on the destination pool.  This is useful
+   * for CACHE_FLUSH and CACHE_EVICT operations.
    */
   enum ObjectOperationGlobalFlags {
     OPERATION_NOFLAG         = 0,
     OPERATION_BALANCE_READS  = 1,
     OPERATION_LOCALIZE_READS = 2,
     OPERATION_ORDER_READS_WRITES = 4,
+    OPERATION_IGNORE_OVERLAY = 8,
   };
 
   /*
index e58ccbdc92e13fa90a3418293dd941a25e630ce8..44dbb40cc5411b54cab5ad13a4b883d6e9a99633 100644 (file)
@@ -995,6 +995,8 @@ int librados::IoCtx::aio_operate(const std::string& oid, AioCompletion *c,
     op_flags |= CEPH_OSD_FLAG_LOCALIZE_READS;
   if (flags & OPERATION_ORDER_READS_WRITES)
     op_flags |= CEPH_OSD_FLAG_RWORDERED;
+  if (flags & OPERATION_IGNORE_OVERLAY)
+    op_flags |= CEPH_OSD_FLAG_IGNORE_OVERLAY;
 
   return io_ctx_impl->aio_operate_read(obj, (::ObjectOperation*)o->impl, c->pc,
                                       op_flags, pbl);
index 3855670f8ebf7d0d52f53a0a418c0d38f1195795..11c8bd95f6f10cd1cfbcfc98d13a900292630889 100644 (file)
@@ -375,6 +375,8 @@ struct ceph_osd_request_head {
       out << " localize_reads";
     if (get_flags() & CEPH_OSD_FLAG_RWORDERED)
       out << " rwordered";
+    if (get_flags() & CEPH_OSD_FLAG_IGNORE_OVERLAY)
+      out << " ignore_overlay";
     out << " e" << osdmap_epoch;
     out << ")";
   }
index fe6d948d403bc1d621cd2f92005796ea31befe31..0c25393524d40ee2aab9c0c5b47b5c55b092d136 100644 (file)
@@ -1035,7 +1035,8 @@ void ReplicatedPG::do_op(OpRequestRef op)
     }
   }
 
-  if (maybe_handle_cache(op, obc, r))
+  if ((m->get_flags() & CEPH_OSD_FLAG_IGNORE_OVERLAY) == 0 &&
+      maybe_handle_cache(op, obc, r))
     return;
 
   if (r) {