]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not trigger clone when set_chunk is called
authormyoungwon oh <ohmyoungwon@gmail.com>
Fri, 31 Jul 2020 07:34:23 +0000 (16:34 +0900)
committermyoungwon oh <ohmyoungwon@gmail.com>
Tue, 18 Aug 2020 13:06:52 +0000 (22:06 +0900)
Signed-off-by: Myoungwon Oh <myoungwon.oh@samsumg.com>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 63d3bffe295ef7613dc38119bb6181c56579ad9a..793d57d93a230a209be4bf68d7822e7dcad3f291 100644 (file)
@@ -5786,6 +5786,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
     case CEPH_OSD_OP_CACHE_PIN:
     case CEPH_OSD_OP_CACHE_UNPIN:
     case CEPH_OSD_OP_SET_REDIRECT:
+    case CEPH_OSD_OP_SET_CHUNK:
     case CEPH_OSD_OP_TIER_PROMOTE:
     case CEPH_OSD_OP_TIER_FLUSH:
       break;
@@ -6123,7 +6124,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
        if (result >= 0) {
          // mark that this is a cache eviction to avoid triggering normal
          // make_writeable() clone creation in finish_ctx()
-         ctx->cache_evict = true;
+         ctx->cache_operation = true;
        }
        osd->logger->inc(l_osd_tier_evict);
       }
@@ -6983,10 +6984,9 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
          result = -EOPNOTSUPP;
          break;
        }
-       if (ctx->snapc.snaps.size() || 
-           (ctx->obc->ssc && ctx->obc->ssc->snapset.clones.size()) ) {
-         result = -EOPNOTSUPP;
-         break;
+       if (oi.manifest.is_redirect()) {
+         result = -EINVAL;
+         goto fail;
        }
 
        object_locator_t tgt_oloc;
@@ -7067,6 +7067,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
            oi.manifest.chunk_map[src_offset].set_flag(chunk_info_t::FLAG_HAS_FINGERPRINT);
          }
          ctx->modify = true;
+         ctx->cache_operation = true;
 
          dout(10) << "set-chunked oid:" << oi.soid << " user_version: " << oi.user_version 
                   << " chunk_info: " << chunk_info << dendl;
@@ -8224,7 +8225,7 @@ void PrimaryLogPG::make_writeable(OpContext *ctx)
 
   if ((ctx->obs->exists && !ctx->obs->oi.is_whiteout()) && // head exist(ed)
       snapc.snaps.size() &&                 // there are snaps
-      !ctx->cache_evict &&
+      !ctx->cache_operation &&
       snapc.snaps[0] > ctx->new_snapset.seq) {  // existing object is old
     // clone
     hobject_t coid = soid;
index 84e503e98001897cf3c0e6571f6bdc3ab8e716d9..9e759ed5cff35b7702f6c66faff2f9741f3cf3e2 100644 (file)
@@ -601,7 +601,7 @@ public:
     bool modify;          // (force) modification (even if op_t is empty)
     bool user_modify;     // user-visible modification
     bool undirty;         // user explicitly un-dirtying this object
-    bool cache_evict;     ///< true if this is a cache eviction
+    bool cache_operation;     ///< true if this is a cache eviction
     bool ignore_cache;    ///< true if IGNORE_CACHE flag is std::set
     bool ignore_log_op_stats;  // don't log op stats
     bool update_log_only; ///< this is a write that returned an error - just record in pg log for dup detection
@@ -708,7 +708,7 @@ public:
       obs(&obc->obs),
       snapset(0),
       new_obs(obs->oi, obs->exists),
-      modify(false), user_modify(false), undirty(false), cache_evict(false),
+      modify(false), user_modify(false), undirty(false), cache_operation(false),
       ignore_cache(false), ignore_log_op_stats(false), update_log_only(false),
       bytes_written(0), bytes_read(0), user_at_version(0),
       current_osd_subop_num(0),
@@ -727,7 +727,7 @@ public:
     OpContext(OpRequestRef _op, osd_reqid_t _reqid,
               std::vector<OSDOp>* _ops, PrimaryLogPG *_pg) :
       op(_op), reqid(_reqid), ops(_ops), obs(NULL), snapset(0),
-      modify(false), user_modify(false), undirty(false), cache_evict(false),
+      modify(false), user_modify(false), undirty(false), cache_operation(false),
       ignore_cache(false), ignore_log_op_stats(false), update_log_only(false),
       bytes_written(0), bytes_read(0), user_at_version(0),
       current_osd_subop_num(0),