From 29a288f9938d5128b303c181bfbd2d17bdfd4a09 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Thu, 21 Mar 2013 13:43:03 -0700 Subject: [PATCH] ReplicatedPG: replica should post BackfillTooFull in do_scan if full Signed-off-by: Samuel Just --- src/osd/ReplicatedPG.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 50318fc5869..dd836ec89cb 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -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); -- 2.47.3