From: Sage Weil Date: Wed, 27 Aug 2014 13:19:12 +0000 (-0700) Subject: osd/PG: fix crash from second backfill reservation rejection X-Git-Tag: v0.86~191^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2b13de16c522754e30a0a55fb9d072082dac455e;p=ceph.git osd/PG: fix crash from second backfill reservation rejection If we get more than one reservation rejection we should ignore them; when we got the first we already sent out cancellations. More importantly, we should not crash. Fixes: #8863 Backport: firefly, dumpling Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 902335ac6e72..1093a20a4a32 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5792,6 +5792,18 @@ PG::RecoveryState::NotBackfilling::NotBackfilling(my_context ctx) context< RecoveryMachine >().log_enter(state_name); } +boost::statechart::result +PG::RecoveryState::NotBackfilling::react(const RemoteBackfillReserved &evt) +{ + return discard_event(); +} + +boost::statechart::result +PG::RecoveryState::NotBackfilling::react(const RemoteReservationRejected &evt) +{ + return discard_event(); +} + void PG::RecoveryState::NotBackfilling::exit() { context< RecoveryMachine >().log_exit(state_name, enter_time); diff --git a/src/osd/PG.h b/src/osd/PG.h index 62278dac115e..104b9f3e30ce 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1717,10 +1717,14 @@ public: struct NotBackfilling : boost::statechart::state< NotBackfilling, Active>, NamedState { typedef boost::mpl::list< - boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved> + boost::statechart::transition< RequestBackfill, WaitLocalBackfillReserved>, + boost::statechart::custom_reaction< RemoteBackfillReserved >, + boost::statechart::custom_reaction< RemoteReservationRejected > > reactions; NotBackfilling(my_context ctx); void exit(); + boost::statechart::result react(const RemoteBackfillReserved& evt); + boost::statechart::result react(const RemoteReservationRejected& evt); }; struct RepNotRecovering;