From: Sage Weil Date: Sat, 10 Dec 2016 22:37:24 +0000 (-0600) Subject: osd/ReplicatedPG: kill hit_set_flushing X-Git-Tag: v12.0.0~334^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=46cdcf82299e8c6848401bd06b73795a397542de;p=ceph.git osd/ReplicatedPG: kill hit_set_flushing This was added before we started taking the ondisk lock in order to allow reading a just-written hitset. Since this is a rare path anyway, just take the ondisk lock. Signed-off-by: Sage Weil --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 0f7c1b70035c..c218f8cd1500 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -11624,7 +11624,6 @@ void PrimaryLogPG::hit_set_clear() dout(20) << __func__ << dendl; hit_set.reset(); hit_set_start_stamp = utime_t(); - hit_set_flushing.clear(); } void PrimaryLogPG::hit_set_setup() @@ -11773,7 +11772,6 @@ void PrimaryLogPG::hit_set_persist() utime_t now = ceph_clock_now(); hobject_t oid; - time_t flush_time = 0; // If any archives are degraded we skip this persist request // account for the additional entry being added below @@ -11835,19 +11833,8 @@ void PrimaryLogPG::hit_set_persist() hit_set_in_memory_trim(size); } - // hold a ref until it is flushed to disk - hit_set_flushing[new_hset.begin] = hit_set; - flush_time = new_hset.begin; - ObjectContextRef obc = get_object_context(oid, true); OpContextUPtr ctx = simple_opc_create(obc); - if (flush_time != 0) { - PrimaryLogPGRef pg(this); - ctx->register_on_applied( - [pg, flush_time]() { - pg->hit_set_flushing.erase(flush_time); - }); - } ctx->at_version = get_next_version(); ctx->updated_hset_history = info.hit_set; @@ -12180,12 +12167,6 @@ void PrimaryLogPG::agent_load_hit_sets() break; } - // check if it's still in flight - if (hit_set_flushing.count(p->begin)) { - agent_state->add_hit_set(p->begin.sec(), hit_set_flushing[p->begin]); - continue; - } - hobject_t oid = get_hit_set_archive_object(p->begin, p->end, p->using_gmt); if (is_unreadable_object(oid)) { dout(10) << __func__ << " unreadable " << oid << ", waiting" << dendl; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 019e871e12d7..dee65e3024cd 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -872,7 +872,6 @@ protected: HitSetRef hit_set; ///< currently accumulating HitSet utime_t hit_set_start_stamp; ///< time the current HitSet started recording - map hit_set_flushing; ///< currently being written, not yet readable void hit_set_clear(); ///< discard any HitSet state void hit_set_setup(); ///< initialize HitSet state