const PushOp &op,
RecoveryMessages *m)
{
- ostringstream ss;
- if (get_parent()->check_failsafe_full(ss)) {
- dout(10) << __func__ << " Out of space (failsafe) processing push request: " << ss.str() << dendl;
+ if (get_parent()->check_failsafe_full()) {
+ dout(10) << __func__ << " Out of space (failsafe) processing push request." << dendl;
ceph_abort();
}
return want != cur;
}
-bool OSDService::_check_full(s_names type, ostream &ss) const
+bool OSDService::_check_full(DoutPrefixProvider *dpp, s_names type) const
{
Mutex::Locker l(full_status_lock);
// or if -1 then always return full
if (injectfull > 0)
--injectfull;
- ss << "Injected " << get_full_state_name(type) << " OSD ("
- << (injectfull < 0 ? "set" : std::to_string(injectfull)) << ")";
+ ldpp_dout(dpp, 10) << __func__ << " Injected " << get_full_state_name(type) << " OSD ("
+ << (injectfull < 0 ? "set" : std::to_string(injectfull)) << ")"
+ << dendl;
return true;
}
+ ldpp_dout(dpp, 10) << __func__ << " current usage is " << cur_ratio << dendl;
- ss << "current usage is " << cur_ratio;
return cur_state >= type;
}
-bool OSDService::check_failsafe_full(ostream &ss) const
+bool OSDService::check_failsafe_full(DoutPrefixProvider *dpp) const
{
- return _check_full(FAILSAFE, ss);
+ return _check_full(dpp, FAILSAFE);
}
-bool OSDService::check_full(ostream &ss) const
+bool OSDService::check_full(DoutPrefixProvider *dpp) const
{
- return _check_full(FULL, ss);
+ return _check_full(dpp, FULL);
}
-bool OSDService::check_backfill_full(ostream &ss) const
+bool OSDService::check_backfill_full(DoutPrefixProvider *dpp) const
{
- return _check_full(BACKFILLFULL, ss);
+ return _check_full(dpp, BACKFILLFULL);
}
-bool OSDService::check_nearfull(ostream &ss) const
+bool OSDService::check_nearfull(DoutPrefixProvider *dpp) const
{
- return _check_full(NEARFULL, ss);
+ return _check_full(dpp, NEARFULL);
}
bool OSDService::is_failsafe_full() const
s_names injectfull_state = NONE;
float get_failsafe_full_ratio();
void check_full_status(float ratio);
- bool _check_full(s_names type, ostream &ss) const;
+ bool _check_full(DoutPrefixProvider *dpp, s_names type) const;
public:
- bool check_failsafe_full(ostream &ss) const;
- bool check_full(ostream &ss) const;
- bool check_backfill_full(ostream &ss) const;
- bool check_nearfull(ostream &ss) const;
+ bool check_failsafe_full(DoutPrefixProvider *dpp) const;
+ bool check_full(DoutPrefixProvider *dpp) const;
+ bool check_backfill_full(DoutPrefixProvider *dpp) const;
+ bool check_nearfull(DoutPrefixProvider *dpp) const;
bool is_failsafe_full() const;
bool is_full() const;
bool is_backfillfull() const;
PG::RecoveryState::RepNotRecovering::react(const RequestBackfillPrio &evt)
{
PG *pg = context< RecoveryMachine >().pg;
- 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(RejectRemoteReservation());
} else if (!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation &&
- pg->osd->check_backfill_full(ss)) {
- ldout(pg->cct, 10) << "backfill reservation rejected: "
- << ss.str() << dendl;
+ pg->osd->check_backfill_full(pg)) {
+ ldout(pg->cct, 10) << "backfill reservation rejected: backfill full"
+ << dendl;
post_event(RejectRemoteReservation());
} else {
Context *preempt = nullptr;
{
PG *pg = context< RecoveryMachine >().pg;
- 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: "
post_event(RejectRemoteReservation());
return discard_event();
} else if (!pg->cct->_conf->osd_debug_skip_full_check_in_backfill_reservation &&
- pg->osd->check_backfill_full(ss)) {
- ldout(pg->cct, 10) << "backfill reservation rejected after reservation: "
- << ss.str() << dendl;
+ pg->osd->check_backfill_full(pg)) {
+ ldout(pg->cct, 10) << "backfill reservation rejected after reservation: backfill full"
+ << dendl;
post_event(RejectRemoteReservation());
return discard_event();
} else {
return ref;
}
-
// ctor
PG(OSDService *o, OSDMapRef curmap,
const PGPool &pool, spg_t p);
virtual LogClientTemp clog_error() = 0;
virtual LogClientTemp clog_warn() = 0;
- virtual bool check_failsafe_full(ostream &ss) = 0;
+ virtual bool check_failsafe_full() = 0;
virtual bool check_osdmap_full(const set<pg_shard_t> &missing_on) = 0;
// mds should have stopped writing before this point.
// We can't allow OSD to become non-startable even if mds
// could be writing as part of file removals.
- ostringstream ss;
- if (write_ordered && osd->check_failsafe_full(ss) && !m->has_flag(CEPH_OSD_FLAG_FULL_TRY)) {
- dout(10) << __func__ << " fail-safe full check failed, dropping request"
- << ss.str()
- << dendl;
+ if (write_ordered && osd->check_failsafe_full(get_dpp()) &&
+ !m->has_flag(CEPH_OSD_FLAG_FULL_TRY)) {
+ dout(10) << __func__ << " fail-safe full check failed, dropping request." << dendl;
return;
}
int64_t poolid = get_pgid().pool();
switch (m->op) {
case MOSDPGScan::OP_SCAN_GET_DIGEST:
{
- ostringstream ss;
- if (osd->check_backfill_full(ss)) {
- dout(1) << __func__ << ": Canceling backfill, " << ss.str() << dendl;
+ auto dpp = get_dpp();
+ if (osd->check_backfill_full(dpp)) {
+ dout(1) << __func__ << ": Canceling backfill: Full." << dendl;
queue_peering_event(
PGPeeringEventRef(
std::make_shared<PGPeeringEvent>(
return r;
}
-bool PrimaryLogPG::check_failsafe_full(ostream &ss) {
- return osd->check_failsafe_full(ss);
+bool PrimaryLogPG::check_failsafe_full() {
+ return osd->check_failsafe_full(get_dpp());
}
void intrusive_ptr_add_ref(PrimaryLogPG *pg) { pg->get("intptr"); }
void on_removal(ObjectStore::Transaction *t) override;
void shutdown() override;
void on_shutdown();
- bool check_failsafe_full(ostream &ss) override;
+ bool check_failsafe_full() override;
bool check_osdmap_full(const set<pg_shard_t> &missing_on) override;
bool maybe_preempt_replica_scrub(const hobject_t& oid) override {
return write_blocked_by_scrub(oid);
vector<PushReplyOp> replies;
ObjectStore::Transaction t;
- ostringstream ss;
- if (get_parent()->check_failsafe_full(ss)) {
- dout(10) << __func__ << " Out of space (failsafe) processing push request: " << ss.str() << dendl;
+ if (get_parent()->check_failsafe_full()) {
+ dout(10) << __func__ << " Out of space (failsafe) processing push request." << dendl;
ceph_abort();
}
for (vector<PushOp>::const_iterator i = m->pushes.begin();
op->mark_started();
vector<PullOp> replies(1);
-
- ostringstream ss;
- if (get_parent()->check_failsafe_full(ss)) {
- dout(10) << __func__ << " Out of space (failsafe) processing pull response (push): " << ss.str() << dendl;
+ if (get_parent()->check_failsafe_full()) {
+ dout(10) << __func__ << " Out of space (failsafe) processing pull response (push)." << dendl;
ceph_abort();
}