]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Better recovery/backfill restart for mark_unfound_lost delete/revert
authorDavid Zafman <dzafman@redhat.com>
Mon, 9 Oct 2017 21:03:23 +0000 (14:03 -0700)
committerDavid Zafman <dzafman@redhat.com>
Wed, 18 Oct 2017 18:12:07 +0000 (11:12 -0700)
Signed-off-by: David Zafman <dzafman@redhat.com>
src/osd/PrimaryLogPG.cc

index a9a6fa233425bcce410410c7a54a4f59048c91b2..fc04412dcf82f2ae34410fe616ce114e20e31554 100644 (file)
@@ -702,7 +702,7 @@ void PrimaryLogPG::wait_for_blocked_object(const hobject_t& soid, OpRequestRef o
 
 void PrimaryLogPG::maybe_force_recovery()
 {
-  // no force if not in degraded/recovery/backfill stats
+  // no force if not in degraded/recovery/backfill states
   if (!is_degraded() &&
       !state_test(PG_STATE_RECOVERING |
                   PG_STATE_RECOVERY_WAIT |
@@ -2314,6 +2314,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op)
   // force recovery of the oldest missing object if too many logs
   maybe_force_recovery();
 }
+
 PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
   OpRequestRef op,
   bool write_ordered,
@@ -10580,7 +10581,23 @@ void PrimaryLogPG::mark_all_unfound_lost(
          release_backoffs(p.first);
        }
        requeue_object_waiters(waiting_for_unreadable_object);
-       queue_recovery();
+       if (is_recovery_unfound()) {
+         queue_peering_event(
+           CephPeeringEvtRef(
+             std::make_shared<CephPeeringEvt>(
+             get_osdmap()->get_epoch(),
+             get_osdmap()->get_epoch(),
+             DoRecovery())));
+       } else if (is_backfill_unfound()) {
+         queue_peering_event(
+           CephPeeringEvtRef(
+             std::make_shared<CephPeeringEvt>(
+             get_osdmap()->get_epoch(),
+             get_osdmap()->get_epoch(),
+             RequestBackfill())));
+       } else {
+         queue_recovery();
+       }
 
        stringstream ss;
        ss << "pg has " << num_unfound