]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: halt backfill on RemoteReservationRejected in Backilling
authorSamuel Just <sam.just@inktank.com>
Thu, 21 Mar 2013 20:37:58 +0000 (13:37 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 22 Mar 2013 01:51:40 +0000 (18:51 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index 273761797629d50c4854808125bf20ae6b47cb0c..c7afee9b74739e00b95e2fcf0ba19cbe86242580 100644 (file)
@@ -5914,6 +5914,19 @@ PG::RecoveryState::Backfilling::Backfilling(my_context ctx)
   pg->state_set(PG_STATE_BACKFILL);
 }
 
+boost::statechart::result
+PG::RecoveryState::Backfilling::react(const RemoteReservationRejected &)
+{
+  PG *pg = context< RecoveryMachine >().pg;
+  pg->osd->local_reserver.cancel_reservation(pg->info.pgid);
+  pg->state_set(PG_STATE_BACKFILL_TOOFULL);
+
+  pg->osd->recovery_wq.dequeue(pg);
+
+  pg->schedule_backfill_full_retry();
+  return transit<NotBackfilling>();
+}
+
 void PG::RecoveryState::Backfilling::exit()
 {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
index c8dd11a7ab3e33e6cae412da3e1e3a4a0fa707f4..5cc19229fb6dad1924ba77551bdfbbe54f82c894 100644 (file)
@@ -1492,9 +1492,11 @@ public:
 
     struct Backfilling : boost::statechart::state< Backfilling, Active >, NamedState {
       typedef boost::mpl::list<
-       boost::statechart::transition< Backfilled, Recovered >
+       boost::statechart::transition< Backfilled, Recovered >,
+       boost::statechart::custom_reaction< RemoteReservationRejected >
        > reactions;
       Backfilling(my_context ctx);
+      boost::statechart::result react(const RemoteReservationRejected& evt);
       void exit();
     };