diff options
author | Sage Weil <sage@inktank.com> | 2013-02-22 17:18:29 -0800 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-02-27 11:21:11 -0800 |
commit | f62c5ab8e86e20c05b3e21feb06a145f301adb92 (patch) | |
tree | 7472104c08003783937bb88637c395eeab3231ec | |
parent | c980b76353c3e7629e5c2dc7bdf10c2184288ad4 (diff) | |
download | ceph-f62c5ab8e86e20c05b3e21feb06a145f301adb92.tar.gz |
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 <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r-- | src/osd/ReplicatedPG.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9155a474d83..ecbc5db072c 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 && |