]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: allow log trimming during recovery
authorSage Weil <sage@inktank.com>
Sat, 23 Feb 2013 01:18:29 +0000 (17:18 -0800)
committerSage Weil <sage@inktank.com>
Wed, 27 Feb 2013 19:21:11 +0000 (11:21 -0800)
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>
src/osd/ReplicatedPG.cc

index 9155a474d832e27d198e393092df0cdd70d818ce..ecbc5db072c44f68cef27639a69c0607cb5b829a 100644 (file)
@@ -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 &&