summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-03-21 13:19:51 -0700
committerSamuel Just <sam.just@inktank.com>2013-03-21 18:51:39 -0700
commit3ab4a09de22e445711cf1f1e1c9b5c4cfbabb79b (patch)
treefbca3346a93b39e8969bb14b7a37223c883372c0
parentcd7353938e1f611fd0e8ae46d34a29ea7a519cc2 (diff)
downloadceph-3ab4a09de22e445711cf1f1e1c9b5c4cfbabb79b.tar.gz
PG: add BackfillTooFull event for RepRecovering
Replica will use this to notify Primary to stop backfilling. Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/PG.cc8
-rw-r--r--src/osd/PG.h5
2 files changed, 12 insertions, 1 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index ab5d3158e1f..cc131163e61 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<RepNotRecovering>();
+}
+
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 60c13fc1407..684266558c7 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();
};