]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: fix crash from second backfill reservation rejection 2344/head
authorSage Weil <sage@redhat.com>
Wed, 27 Aug 2014 13:19:12 +0000 (06:19 -0700)
committerSage Weil <sage@redhat.com>
Wed, 27 Aug 2014 13:19:12 +0000 (06:19 -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>
src/osd/PG.cc
src/osd/PG.h

index 902335ac6e72fbd6c5ab3c1db466d07e5755c9b9..1093a20a4a32b5b5140513ba1169c871f0898137 100644 (file)
@@ -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);
index 62278dac115e0acf40d60264ce1e8c774e65ef91..104b9f3e30ce52fcea850cba45e9aa996aecba8f 100644 (file)
@@ -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;