diff options
author | Samuel Just <sam.just@inktank.com> | 2013-03-21 13:43:03 -0700 |
---|---|---|
committer | Samuel Just <sam.just@inktank.com> | 2013-03-21 18:51:40 -0700 |
commit | 29a288f9938d5128b303c181bfbd2d17bdfd4a09 (patch) | |
tree | a343b8999db238f09ea3e26b6b9617a72bb92dbf | |
parent | f9c8190e4f8546f53de608dd375cdfe22e0a278c (diff) | |
download | ceph-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.cc | 13 |
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); |