]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: add BackfillTooFull event for RepRecovering
authorSamuel Just <sam.just@inktank.com>
Thu, 21 Mar 2013 20:19:51 +0000 (13:19 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 22 Mar 2013 01:51:39 +0000 (18:51 -0700)
Replica will use this to notify Primary to stop backfilling.

Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index ab5d3158e1f262efa457ae54d245d9776047ae94..cc131163e619290f59a5193eeda9efd772837682 100644 (file)
@@ -6125,6 +6125,14 @@ PG::RecoveryState::RepRecovering::RepRecovering(my_context ctx)
   context< RecoveryMachine >().log_enter(state_name);
 }
 
+boost::statechart::result
+PG::RecoveryState::RepRecovering::react(const BackfillTooFull &)
+{
+  PG *pg = context< RecoveryMachine >().pg;
+  pg->reject_reservation();
+  return transit<RepNotRecovering>();
+}
+
 void PG::RecoveryState::RepRecovering::exit()
 {
   context< RecoveryMachine >().log_exit(state_name, enter_time);
index 60c13fc1407e5fe2515539689115f6121b37216d..684266558c79ea4e0be60011db972828fdb0d88a 100644 (file)
@@ -1178,6 +1178,7 @@ public:
   TrivialEvent(RequestBackfill)
   TrivialEvent(RequestRecovery)
   TrivialEvent(RecoveryDone)
+  TrivialEvent(BackfillTooFull)
 
   TrivialEvent(AllReplicasRecovered)
   TrivialEvent(DoRecovery)
@@ -1528,9 +1529,11 @@ public:
 
     struct RepRecovering : boost::statechart::state< RepRecovering, ReplicaActive >, NamedState {
       typedef boost::mpl::list<
-       boost::statechart::transition< RecoveryDone, RepNotRecovering >
+       boost::statechart::transition< RecoveryDone, RepNotRecovering >,
+       boost::statechart::custom_reaction< BackfillTooFull >
        > reactions;
       RepRecovering(my_context ctx);
+      boost::statechart::result react(const BackfillTooFull &evt);
       void exit();
     };