From: Kefu Chai Date: Fri, 12 Jun 2015 12:53:44 +0000 (+0800) Subject: osd: remove useless hitset code X-Git-Tag: v9.1.0~297^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ff087f9e01b3cb4a3cee1232b5d8096b99a8100b;p=ceph.git osd: remove useless hitset code * 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 --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index eeb1f2998d5..13e32bae9c9 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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);