summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-10-22 18:44:03 -0700
committerSage Weil <sage@inktank.com>2013-10-22 19:40:50 -0700
commit79f7a1ed2a942bee1781fe16e607b5e873cbcbe3 (patch)
tree1c013c377024de5c06bee17d9e30c0bb0c7420de
parent3dd18cca7014489fd11e68c9a6ed568ab6013c44 (diff)
downloadceph-79f7a1ed2a942bee1781fe16e607b5e873cbcbe3.tar.gz
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 <sage@inktank.com>
-rw-r--r--src/include/rados.h1
-rw-r--r--src/include/rados/librados.hpp5
-rw-r--r--src/librados/librados.cc2
-rw-r--r--src/messages/MOSDOp.h2
-rw-r--r--src/osd/ReplicatedPG.cc3
5 files changed, 12 insertions, 1 deletions
diff --git a/src/include/rados.h b/src/include/rados.h
index 2415652ddfc..fe2509dcca3 100644
--- a/src/include/rados.h
+++ b/src/include/rados.h
@@ -345,6 +345,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 44f1d174b3a..12b3655954e 100644
--- a/src/include/rados/librados.hpp
+++ b/src/include/rados/librados.hpp
@@ -144,12 +144,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 9a6f91e138c..7980afc5a62 100644
--- a/src/librados/librados.cc
+++ b/src/librados/librados.cc
@@ -996,6 +996,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 3855670f8eb..11c8bd95f6f 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 8b8654061fa..02c0e0cee9f 100644
--- a/src/osd/ReplicatedPG.cc
+++ b/src/osd/ReplicatedPG.cc
@@ -1023,7 +1023,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) {