From: Samuel Just Date: Thu, 21 Mar 2013 20:19:51 +0000 (-0700) Subject: PG: add BackfillTooFull event for RepRecovering X-Git-Tag: v0.62~184^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ab4a09de22e445711cf1f1e1c9b5c4cfbabb79b;p=ceph.git PG: add BackfillTooFull event for RepRecovering Replica will use this to notify Primary to stop backfilling. Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index ab5d3158e1f2..cc131163e619 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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(); +} + void PG::RecoveryState::RepRecovering::exit() { context< RecoveryMachine >().log_exit(state_name, enter_time); diff --git a/src/osd/PG.h b/src/osd/PG.h index 60c13fc1407e..684266558c79 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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(); };