From: Sage Weil Date: Sat, 23 Feb 2013 01:18:29 +0000 (-0800) Subject: osd: allow log trimming during recovery X-Git-Tag: v0.59~82 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f62c5ab8e86e20c05b3e21feb06a145f301adb92;p=ceph.git osd: allow log trimming during recovery We rely on min_last_complete_ondisk being accurate; as long as we have logs from that point, the current replicas will be able to safely recovery via their logs. Bump the target size, just as we do with degraded. Signed-off-by: Sage Weil Reviewed-by: Samuel Just --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9155a474d832..ecbc5db072c4 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -560,16 +560,6 @@ void ReplicatedPG::do_pg_op(OpRequestRef op) void ReplicatedPG::calc_trim_to() { - if (state_test(PG_STATE_RECOVERING | - PG_STATE_RECOVERY_WAIT | - PG_STATE_BACKFILL | - PG_STATE_BACKFILL_WAIT | - PG_STATE_BACKFILL_TOOFULL)) { - dout(10) << "calc_trim_to no trim during recovery" << dendl; - pg_trim_to = eversion_t(); - return; - } - if (is_scrubbing() && scrubber.classic) { dout(10) << "calc_trim_to no trim during classic scrub" << dendl; pg_trim_to = eversion_t(); @@ -577,8 +567,14 @@ void ReplicatedPG::calc_trim_to() } size_t target = g_conf->osd_min_pg_log_entries; - if (is_degraded()) + if (is_degraded() || + state_test(PG_STATE_RECOVERING | + PG_STATE_RECOVERY_WAIT | + PG_STATE_BACKFILL | + PG_STATE_BACKFILL_WAIT | + PG_STATE_BACKFILL_TOOFULL)) { target = g_conf->osd_max_pg_log_entries; + } if (min_last_complete_ondisk != eversion_t() && min_last_complete_ondisk != pg_trim_to &&