From: Sage Weil Date: Wed, 23 Oct 2013 01:44:03 +0000 (-0700) Subject: librados, osd: add IGNORE_OVERLAY flag X-Git-Tag: v0.75~45^2~60 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=181cb8e83cc010884bda4d650ca1b08a22e716f9;p=ceph.git librados, osd: add IGNORE_OVERLAY flag 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 --- diff --git a/src/include/rados.h b/src/include/rados.h index 2ab293daa689..484f22175165 100644 --- a/src/include/rados.h +++ b/src/include/rados.h @@ -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 { diff --git a/src/include/rados/librados.hpp b/src/include/rados/librados.hpp index e66ef224f2ef..7e7f069ff2f4 100644 --- a/src/include/rados/librados.hpp +++ b/src/include/rados/librados.hpp @@ -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, }; /* diff --git a/src/librados/librados.cc b/src/librados/librados.cc index e58ccbdc92e1..44dbb40cc541 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -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); diff --git a/src/messages/MOSDOp.h b/src/messages/MOSDOp.h index 3855670f8ebf..11c8bd95f6f1 100644 --- a/src/messages/MOSDOp.h +++ b/src/messages/MOSDOp.h @@ -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 << ")"; } diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index fe6d948d403b..0c25393524d4 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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) {