summaryrefslogtreecommitdiffstats
path: root/src/osd
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2015-09-12 15:19:20 +0200
committerSage Weil <sage@redhat.com>2015-09-12 15:19:20 +0200
commit2e44373eac24950acfb28de4c1a89c6d034f3eec (patch)
tree9c96177394b47a171ac6c78f6691d34d20c051e2 /src/osd
parentosd/ReplicatedPG: remove stray debug line (diff)
parentosd: force promote for ops which ec base pool can't handle (diff)
downloadceph-2e44373eac24950acfb28de4c1a89c6d034f3eec.tar.xz
ceph-2e44373eac24950acfb28de4c1a89c6d034f3eec.zip
Merge pull request #5776 from wonzhq/tmap-update
osd: force promote for ops which ec base pool can't handle Reviewed-by: Josh Durgin <jdurgin@redhat.com> Reviewed-by: Loic Dachary <ldachary@redhat.com>
Diffstat (limited to 'src/osd')
-rw-r--r--src/osd/OSD.cc51
1 files changed, 34 insertions, 17 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index a577fd802c8..58d6097eaa0 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -8650,6 +8650,40 @@ int OSD::init_op_flags(OpRequestRef& op)
if (ceph_osd_op_mode_cache(iter->op.op))
op->set_cache();
+ // check for ec base pool
+ int64_t poolid = m->get_pg().pool();
+ const pg_pool_t *pool = osdmap->get_pg_pool(poolid);
+ if (pool && pool->is_tier()) {
+ const pg_pool_t *base_pool = osdmap->get_pg_pool(pool->tier_of);
+ if (base_pool && base_pool->require_rollback()) {
+ if ((iter->op.op != CEPH_OSD_OP_READ) &&
+ (iter->op.op != CEPH_OSD_OP_STAT) &&
+ (iter->op.op != CEPH_OSD_OP_ISDIRTY) &&
+ (iter->op.op != CEPH_OSD_OP_UNDIRTY) &&
+ (iter->op.op != CEPH_OSD_OP_GETXATTR) &&
+ (iter->op.op != CEPH_OSD_OP_GETXATTRS) &&
+ (iter->op.op != CEPH_OSD_OP_CMPXATTR) &&
+ (iter->op.op != CEPH_OSD_OP_SRC_CMPXATTR) &&
+ (iter->op.op != CEPH_OSD_OP_ASSERT_VER) &&
+ (iter->op.op != CEPH_OSD_OP_LIST_WATCHERS) &&
+ (iter->op.op != CEPH_OSD_OP_LIST_SNAPS) &&
+ (iter->op.op != CEPH_OSD_OP_ASSERT_SRC_VERSION) &&
+ (iter->op.op != CEPH_OSD_OP_SETALLOCHINT) &&
+ (iter->op.op != CEPH_OSD_OP_WRITEFULL) &&
+ (iter->op.op != CEPH_OSD_OP_ROLLBACK) &&
+ (iter->op.op != CEPH_OSD_OP_CREATE) &&
+ (iter->op.op != CEPH_OSD_OP_DELETE) &&
+ (iter->op.op != CEPH_OSD_OP_SETXATTR) &&
+ (iter->op.op != CEPH_OSD_OP_RMXATTR) &&
+ (iter->op.op != CEPH_OSD_OP_STARTSYNC) &&
+ (iter->op.op != CEPH_OSD_OP_COPY_GET_CLASSIC) &&
+ (iter->op.op != CEPH_OSD_OP_COPY_GET) &&
+ (iter->op.op != CEPH_OSD_OP_COPY_FROM)) {
+ op->set_promote();
+ }
+ }
+ }
+
switch (iter->op.op) {
case CEPH_OSD_OP_CALL:
{
@@ -8725,23 +8759,6 @@ int OSD::init_op_flags(OpRequestRef& op)
}
break;
- case CEPH_OSD_OP_WRITE:
- case CEPH_OSD_OP_ZERO:
- case CEPH_OSD_OP_TRUNCATE:
- // always force promotion for object overwrites on a ec base pool
- {
- int64_t poolid = m->get_pg().pool();
- const pg_pool_t *pool = osdmap->get_pg_pool(poolid);
- if (pool->is_tier()) {
- const pg_pool_t *base_pool = osdmap->get_pg_pool(pool->tier_of);
- assert(base_pool);
- if (base_pool->is_erasure()) {
- op->set_promote();
- }
- }
- }
- break;
-
case CEPH_OSD_OP_READ:
case CEPH_OSD_OP_SYNC_READ:
case CEPH_OSD_OP_SPARSE_READ: