From 598cde42e7f57fd0b294f70c0a930f94fd361fb3 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 27 Aug 2014 06:19:12 -0700 Subject: [PATCH] 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 (cherry picked from commit 2b13de16c522754e30a0a55fb9d072082dac455e) --- src/osd/PG.cc | 12 ++++++++++++ src/osd/PG.h | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index e9e3c7709e66..120aac03d1e2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -5935,6 +5935,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 0cdf5ba7ae3f..1813807de68f 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1723,10 +1723,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; -- 2.47.3