!pool.info.hit_set_period ||
pool.info.hit_set_params.get_type() == HitSet::TYPE_NONE) {
hit_set_clear();
- //hit_set_remove_all(); // FIXME: implement me soon
+ hit_set_remove_all();
return;
}
hit_set_apply_log();
}
+void ReplicatedPG::hit_set_remove_all()
+{
+ // If any archives are degraded we skip this
+ for (list<pg_hit_set_info_t>::iterator p = info.hit_set.history.begin();
+ p != info.hit_set.history.end();
+ ++p) {
+ hobject_t aoid = get_hit_set_archive_object(p->begin, p->end, p->using_gmt);
+
+ // Once we hit a degraded object just skip
+ if (is_degraded_or_backfilling_object(aoid))
+ return;
+ if (scrubber.write_blocked_by_scrub(aoid))
+ return;
+ }
+
+ if (!info.hit_set.history.empty()) {
+ list<pg_hit_set_info_t>::reverse_iterator p = info.hit_set.history.rbegin();
+ assert(p != info.hit_set.history.rend());
+ hobject_t oid = get_hit_set_archive_object(p->begin, p->end, p->using_gmt);
+ assert(!is_degraded_or_backfilling_object(oid));
+ ObjectContextRef obc = get_object_context(oid, false);
+ assert(obc);
+
+ RepGather *repop = simple_repop_create(obc);
+ OpContext *ctx = repop->ctx;
+ ctx->at_version = get_next_version();
+ ctx->updated_hset_history = info.hit_set;
+ utime_t now = ceph_clock_now(cct);
+ ctx->mtime = now;
+ hit_set_trim(repop, 0);
+ info.stats.stats.add(ctx->delta_stats);
+ simple_repop_submit(repop);
+ }
+
+ info.hit_set = pg_hit_set_history_t();
+ if (agent_state) {
+ agent_state->discard_hit_sets();
+ }
+}
+
void ReplicatedPG::hit_set_create()
{
utime_t now = ceph_clock_now(NULL);
bool hit_set_apply_log(); ///< apply log entries to update in-memory HitSet
void hit_set_trim(RepGather *repop, unsigned max); ///< discard old HitSets
void hit_set_in_memory_trim(); ///< discard old in memory HitSets
+ void hit_set_remove_all();
hobject_t get_hit_set_current_object(utime_t stamp);
hobject_t get_hit_set_archive_object(utime_t start,