]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: use OSDService::too_full_for_backfill in RepWaitBackfillReserved
authorSamuel Just <sam.just@inktank.com>
Thu, 21 Mar 2013 19:08:50 +0000 (12:08 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 22 Mar 2013 01:51:39 +0000 (18:51 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/PG.cc

index c0d6cb4cf86f4911f1fd65eee95ce84afb75d2fa..1c6450eadaeb4d562917fbe5e199c1732d8c3d1b 100644 (file)
@@ -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(