From: Samuel Just Date: Thu, 21 Mar 2013 19:08:50 +0000 (-0700) Subject: PG: use OSDService::too_full_for_backfill in RepWaitBackfillReserved X-Git-Tag: v0.62~184^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=33aaea594d0fcde493bc612a6f544a7523b0f97b;p=ceph.git PG: use OSDService::too_full_for_backfill in RepWaitBackfillReserved Signed-off-by: Samuel Just --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index c0d6cb4cf86f..1c6450eadaeb 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(