return cur_state >= FULL;
}
-bool OSDService::too_full_for_backfill(double *_ratio, double *_max_ratio)
+bool OSDService::too_full_for_backfill(ostream &ss)
{
Mutex::Locker l(full_status_lock);
double max_ratio;
max_ratio = cct->_conf->osd_backfill_full_ratio;
- if (_ratio)
- *_ratio = cur_ratio;
- if (_max_ratio)
- *_max_ratio = max_ratio;
+ ss << "current usage is " << cur_ratio << ", which is greater than max allowed ratio " << max_ratio;
return cur_ratio >= max_ratio;
}
PG::RecoveryState::RepNotRecovering::react(const RequestBackfillPrio &evt)
{
PG *pg = context< RecoveryMachine >().pg;
- double ratio, max_ratio;
+ ostringstream ss;
if (pg->cct->_conf->osd_debug_reject_backfill_probability > 0 &&
(rand()%1000 < (pg->cct->_conf->osd_debug_reject_backfill_probability*1000.0))) {
ldout(pg->cct, 10) << "backfill reservation rejected: failure injection"
<< dendl;
post_event(RemoteReservationRejected());
- } else if (pg->osd->too_full_for_backfill(&ratio, &max_ratio) &&
+ } else if (pg->osd->too_full_for_backfill(ss) &&
!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation) {
- ldout(pg->cct, 10) << "backfill reservation rejected: full ratio is "
- << ratio << ", which is greater than max allowed ratio "
- << max_ratio << dendl;
+ ldout(pg->cct, 10) << "backfill reservation rejected: "
+ << ss.str() << dendl;
post_event(RemoteReservationRejected());
} else {
pg->osd->remote_reserver.request_reservation(
{
PG *pg = context< RecoveryMachine >().pg;
- double ratio, max_ratio;
+ ostringstream ss;
if (pg->cct->_conf->osd_debug_reject_backfill_probability > 0 &&
(rand()%1000 < (pg->cct->_conf->osd_debug_reject_backfill_probability*1000.0))) {
ldout(pg->cct, 10) << "backfill reservation rejected after reservation: "
pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
post_event(RemoteReservationRejected());
return discard_event();
- } else if (pg->osd->too_full_for_backfill(&ratio, &max_ratio) &&
+ } else if (pg->osd->too_full_for_backfill(ss) &&
!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation) {
- ldout(pg->cct, 10) << "backfill reservation rejected after reservation: full ratio is "
- << ratio << ", which is greater than max allowed ratio "
- << max_ratio << dendl;
+ ldout(pg->cct, 10) << "backfill reservation rejected after reservation: "
+ << ss.str() << dendl;
pg->osd->remote_reserver.cancel_reservation(pg->info.pgid);
post_event(RemoteReservationRejected());
return discard_event();
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;
+ ostringstream ss;
+ if (osd->too_full_for_backfill(ss)) {
+ dout(1) << __func__ << ": Canceling backfill, " << ss.str() << dendl;
queue_peering_event(
CephPeeringEvtRef(
std::make_shared<CephPeeringEvt>(