]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove useless hitset code
authorKefu Chai <kchai@redhat.com>
Fri, 12 Jun 2015 12:53:44 +0000 (20:53 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 23 Aug 2015 09:32:37 +0000 (17:32 +0800)
* we do not persist current hit set using get_hit_set_current_object()
  anymore, instead we always append current hitset into archive even
  !hitset.is_full(), see fbd9c15. so it's not necessary to remove the
  current hitset object before putting it to disk.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/osd/ReplicatedPG.cc

index eeb1f2998d548b7d1a3bfe68efe865378b835607..13e32bae9c90ded47a5a80982ff2ee593b553f77 100644 (file)
@@ -10785,43 +10785,8 @@ void ReplicatedPG::hit_set_persist()
   ctx->updated_hset_history = info.hit_set;
   pg_hit_set_history_t &updated_hit_set_hist = *(ctx->updated_hset_history);
 
-  if (updated_hit_set_hist.current_last_stamp != utime_t()) {
-    // FIXME: we cheat slightly here by bundling in a remove on a object
-    // other the RepGather object.  we aren't carrying an ObjectContext for
-    // the deleted object over this period.
-    hobject_t old_obj =
-      get_hit_set_current_object(updated_hit_set_hist.current_last_stamp);
-    ctx->log.push_back(
-      pg_log_entry_t(pg_log_entry_t::DELETE,
-                    old_obj,
-                    ctx->at_version,
-                    updated_hit_set_hist.current_last_update,
-                    0,
-                    osd_reqid_t(),
-                    ctx->mtime));
-    if (pool.info.require_rollback()) {
-      if (ctx->log.back().mod_desc.rmobject(ctx->at_version.version)) {
-       ctx->op_t->stash(old_obj, ctx->at_version.version);
-      } else {
-       ctx->op_t->remove(old_obj);
-      }
-    } else {
-      ctx->op_t->remove(old_obj);
-      ctx->log.back().mod_desc.mark_unrollbackable();
-    }
-    ++ctx->at_version.version;
-
-    struct stat st;
-    int r = osd->store->stat(
-      coll,
-      ghobject_t(old_obj, ghobject_t::NO_GEN, pg_whoami.shard),
-      &st);
-    assert(r == 0);
-    --ctx->delta_stats.num_objects;
-    ctx->delta_stats.num_bytes -= st.st_size;
-  }
 
-  updated_hit_set_hist.current_last_update = info.last_update; // *after* above remove!
+  updated_hit_set_hist.current_last_update = info.last_update;
   updated_hit_set_hist.current_info.version = ctx->at_version;
 
   updated_hit_set_hist.history.push_back(updated_hit_set_hist.current_info);