summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-03-21 13:43:03 -0700
committerSamuel Just <sam.just@inktank.com>2013-03-21 18:51:40 -0700
commit29a288f9938d5128b303c181bfbd2d17bdfd4a09 (patch)
treea343b8999db238f09ea3e26b6b9617a72bb92dbf
parentf9c8190e4f8546f53de608dd375cdfe22e0a278c (diff)
downloadceph-29a288f9938d5128b303c181bfbd2d17bdfd4a09.tar.gz
ReplicatedPG: replica should post BackfillTooFull in do_scan if full
Signed-off-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/osd/ReplicatedPG.cc13
1 files changed, 13 insertions, 0 deletions
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);