From f9c8190e4f8546f53de608dd375cdfe22e0a278c Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 21 Mar 2013 13:37:58 -0700 Subject: [PATCH] PG: halt backfill on RemoteReservationRejected in Backilling Signed-off-by: Samuel Just --- src/osd/PG.cc | 13 +++++++++++++ src/osd/PG.h | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 273761797629d..c7afee9b74739 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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(); +} + void PG::RecoveryState::Backfilling::exit() { context< RecoveryMachine >().log_exit(state_name, enter_time); diff --git a/src/osd/PG.h b/src/osd/PG.h index c8dd11a7ab3e3..5cc19229fb6da 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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(); }; -- 2.39.5