]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: fix crash from second backfill reservation rejection
authorSage Weil <sage@redhat.com>
Wed, 27 Aug 2014 13:19:12 +0000 (06:19 -0700)
committerSage Weil <sage@redhat.com>
Mon, 8 Sep 2014 17:31:24 +0000 (10:31 -0700)
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 <sage@redhat.com>
(cherry picked from commit 2b13de16c522754e30a0a55fb9d072082dac455e)

src/osd/PG.cc
src/osd/PG.h

index e9e3c7709e662b3f0e17b7eccd91d88389f0fd2d..120aac03d1e261456723ab8f9730f5776dc1b5af 100644 (file)
@@ -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);
index 0cdf5ba7ae3fee55373dbff05dcb56f0abcc7a19..1813807de68f68c2d2b95c45c699f31256ad5175 100644 (file)
@@ -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;