summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Farnum <greg@inktank.com>2013-09-26 13:19:58 -0700
committerGreg Farnum <greg@inktank.com>2013-09-26 13:22:07 -0700
commitc5468bbdcd6af91e2f22a9d8de275cb022628dd8 (patch)
treef14fbb83973532f991929133b8780c90930b78f8
parentfa048e22ab0d58dc3ec5d5d64d9b548671e7b70a (diff)
downloadceph-c5468bbdcd6af91e2f22a9d8de275cb022628dd8.tar.gz
Objecter: add "honor_cache_redirects" flag covering cache settings
When set to false, we do not redirect based on the cache_pool data in the OSDMap. We'll use this so the OSDs can actually fetch data into the cache pools on promotion! Signed-off-by: Greg Farnum <greg@inktank.com>
-rw-r--r--src/osdc/Objecter.cc4
-rw-r--r--src/osdc/Objecter.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc
index 6c0486ce801..6d25a9c8b68 100644
--- a/src/osdc/Objecter.cc
+++ b/src/osdc/Objecter.cc
@@ -1329,11 +1329,11 @@ int Objecter::recalc_op_target(Op *op)
bool is_write = op->flags & CEPH_OSD_FLAG_WRITE;
bool need_check_tiering = false;
- if (op->target_oid.name.empty()) {
+ if (honor_cache_redirects && op->target_oid.name.empty()) {
op->target_oid = op->base_oid;
need_check_tiering = true;
}
- if (op->target_oloc.empty()) {
+ if (honor_cache_redirects && op->target_oloc.empty()) {
op->target_oloc = op->base_oloc;
need_check_tiering = true;
}
diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h
index 880023ab37b..eef226ad9b2 100644
--- a/src/osdc/Objecter.h
+++ b/src/osdc/Objecter.h
@@ -785,6 +785,7 @@ class Objecter {
int global_op_flags; // flags which are applied to each IO op
bool keep_balanced_budget;
bool honor_osdmap_full;
+ bool honor_cache_redirects;
void maybe_request_map();
@@ -1260,6 +1261,7 @@ public:
num_unacked(0), num_uncommitted(0),
global_op_flags(0),
keep_balanced_budget(false), honor_osdmap_full(true),
+ honor_cache_redirects(true),
last_seen_osdmap_version(0),
last_seen_pgmap_version(0),
client_lock(l), timer(t),
@@ -1293,6 +1295,9 @@ public:
void set_honor_osdmap_full() { honor_osdmap_full = true; }
void unset_honor_osdmap_full() { honor_osdmap_full = false; }
+ void set_honor_cache_redirects() { honor_cache_redirects = true; }
+ void unset_honor_cache_redirects() { honor_cache_redirects = false; }
+
void scan_requests(bool skipped_map,
map<tid_t, Op*>& need_resend,
list<LingerOp*>& need_resend_linger,