]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: replica should post BackfillTooFull in do_scan if full
authorSamuel Just <sam.just@inktank.com>
Thu, 21 Mar 2013 20:43:03 +0000 (13:43 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 22 Mar 2013 01:51:40 +0000 (18:51 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index 50318fc5869de8ae7bc23a873c7e408fb3db5684..dd836ec89cb5f0336859cd434a6e6bfdab47eb77 100644 (file)
@@ -1186,6 +1186,19 @@ void ReplicatedPG::do_scan(OpRequestRef op)
   switch (m->op) {
   case MOSDPGScan::OP_SCAN_GET_DIGEST:
     {
+      double ratio, full_ratio;
+      if (osd->too_full_for_backfill(&ratio, &full_ratio)) {
+       dout(1) << __func__ << ": Canceling backfill, current usage is "
+               << ratio << ", which exceeds " << full_ratio << dendl;
+       queue_peering_event(
+         CephPeeringEvtRef(
+           new CephPeeringEvt(
+             get_osdmap()->get_epoch(),
+             get_osdmap()->get_epoch(),
+             BackfillTooFull())));
+       return;
+      }
+
       BackfillInterval bi;
       osr->flush();
       scan_range(m->begin, g_conf->osd_backfill_scan_min, g_conf->osd_backfill_scan_max, &bi);