summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-03-21 12:08:50 -0700
committerSamuel Just <sam.just@inktank.com>2013-03-21 18:51:39 -0700
commit33aaea594d0fcde493bc612a6f544a7523b0f97b (patch)
tree2a5787b166833d9d31acdb2c828b36b81753364b
parentcec3d82ec427811044fde0ea017e3e48a1b99dcb (diff)
downloadceph-33aaea594d0fcde493bc612a6f544a7523b0f97b.tar.gz
PG: use OSDService::too_full_for_backfill in RepWaitBackfillReserved
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/PG.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index c0d6cb4cf86..1c6450eadae 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -3294,7 +3294,6 @@ void PG::sub_op_scrub_stop(OpRequestRef op)
osd->send_message_osd_cluster(reply, m->get_connection());
}
-
void PG::clear_scrub_reserved()
{
osd->scrub_wq.dequeue(this);
@@ -6065,12 +6064,11 @@ PG::RecoveryState::RepWaitBackfillReserved::RepWaitBackfillReserved(my_context c
context< RecoveryMachine >().log_enter(state_name);
PG *pg = context< RecoveryMachine >().pg;
- int64_t kb = pg->osd->osd->osd_stat.kb,
- kb_used = pg->osd->osd->osd_stat.kb_used;
- int64_t max = kb * g_conf->osd_backfill_full_ratio;
- if (kb_used >= max) {
- dout(10) << "backfill reservation rejected: kb used >= max: "
- << kb_used << " >= " << max << dendl;
+ double ratio, max_ratio;
+ if (pg->osd->too_full_for_backfill(&ratio, &max_ratio)) {
+ dout(10) << "backfill reservation rejected: full ratio is "
+ << ratio << ", which is greater than max allowed ratio "
+ << max_ratio << dendl;
post_event(RemoteReservationRejected());
} else {
pg->osd->remote_reserver.request_reservation(