summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-03-21 13:18:41 -0700
committerSamuel Just <sam.just@inktank.com>2013-03-21 18:51:39 -0700
commitcd7353938e1f611fd0e8ae46d34a29ea7a519cc2 (patch)
tree03eefec0392cf1b637a58a898c4829e01f44af36
parent33aaea594d0fcde493bc612a6f544a7523b0f97b (diff)
downloadceph-cd7353938e1f611fd0e8ae46d34a29ea7a519cc2.tar.gz
PG: add helper for rejecting backfill reservation
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/PG.cc19
-rw-r--r--src/osd/PG.h1
2 files changed, 13 insertions, 7 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index 1c6450eadae..ab5d3158e1f 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -3294,6 +3294,17 @@ void PG::sub_op_scrub_stop(OpRequestRef op)
osd->send_message_osd_cluster(reply, m->get_connection());
}
+void PG::reject_reservation()
+{
+ osd->send_message_osd_cluster(
+ acting[0],
+ new MBackfillReserve(
+ MBackfillReserve::REJECT,
+ info.pgid,
+ get_osdmap()->get_epoch()),
+ get_osdmap()->get_epoch());
+}
+
void PG::clear_scrub_reserved()
{
osd->scrub_wq.dequeue(this);
@@ -6102,13 +6113,7 @@ boost::statechart::result
PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteReservationRejected &evt)
{
PG *pg = context< RecoveryMachine >().pg;
- pg->osd->send_message_osd_cluster(
- pg->acting[0],
- new MBackfillReserve(
- MBackfillReserve::REJECT,
- pg->info.pgid,
- pg->get_osdmap()->get_epoch()),
- pg->get_osdmap()->get_epoch());
+ pg->reject_reservation();
return transit<RepNotRecovering>();
}
diff --git a/src/osd/PG.h b/src/osd/PG.h
index b24c74f8bf5..60c13fc1407 100644
--- a/src/osd/PG.h
+++ b/src/osd/PG.h
@@ -1050,6 +1050,7 @@ public:
void sub_op_scrub_unreserve(OpRequestRef op);
void sub_op_scrub_stop(OpRequestRef op);
+ void reject_reservation();
// -- recovery state --