From 1b0875ca6d9ab91f59ffe2356113ed2cc643a276 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 21 Sep 2017 10:30:57 -0400 Subject: [PATCH] osd: PG_STATE_BACKFILL -> PG_STATE_BACKFILLING Match user-facing string Signed-off-by: Sage Weil (cherry picked from commit 31a34946f7aa0ad2b9848cbc808d209394a9ad44) - add update to mon/PGMap.cc --- src/mgr/DaemonServer.cc | 2 +- src/mon/PGMap.cc | 4 ++-- src/osd/OSD.cc | 4 ++-- src/osd/PG.cc | 6 +++--- src/osd/PrimaryLogPG.cc | 10 +++++----- src/osd/osd_types.cc | 4 ++-- src/osd/osd_types.h | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 34aac18718188..d8d5bc39be554 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1148,7 +1148,7 @@ bool DaemonServer::handle_command(MCommand *m) } break; case OFR_BACKFILL: - if ((workpg.state & (PG_STATE_DEGRADED | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILL)) == 0) { + if ((workpg.state & (PG_STATE_DEGRADED | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILLING)) == 0) { ss << "pg " << pstr << " doesn't require backfilling; "; continue; } else if (workpg.state & PG_STATE_FORCED_BACKFILL) { diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index fde038fc5806a..5fae72c974cc4 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -3326,7 +3326,7 @@ void PGMap::get_health( note["incomplete"] += p->second; if (p->first & PG_STATE_BACKFILL_WAIT) note["backfill_wait"] += p->second; - if (p->first & PG_STATE_BACKFILL) + if (p->first & PG_STATE_BACKFILLING) note["backfilling"] += p->second; if (p->first & PG_STATE_BACKFILL_TOOFULL) note["backfill_toofull"] += p->second; @@ -3431,7 +3431,7 @@ void PGMap::get_health( PG_STATE_RECOVERY_TOOFULL | PG_STATE_INCOMPLETE | PG_STATE_BACKFILL_WAIT | - PG_STATE_BACKFILL | + PG_STATE_BACKFILLING | PG_STATE_BACKFILL_TOOFULL)) && stuck_pgs.count(p->first) == 0) { if (max > 0) { diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index db1a93266f0d8..a77db0dc916c6 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9315,7 +9315,7 @@ void OSDService::adjust_pg_priorities(const vector& pgs, int newflags) i->lock(); int pgstate = i->get_state(); if ( ((newstate == PG_STATE_FORCED_RECOVERY) && (pgstate & (PG_STATE_DEGRADED | PG_STATE_RECOVERY_WAIT | PG_STATE_RECOVERING))) || - ((newstate == PG_STATE_FORCED_BACKFILL) && (pgstate & (PG_STATE_DEGRADED | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILL))) ) + ((newstate == PG_STATE_FORCED_BACKFILL) && (pgstate & (PG_STATE_DEGRADED | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILLING))) ) i->_change_recovery_force_mode(newstate, false); i->unlock(); } @@ -9400,7 +9400,7 @@ void OSD::do_recovery( pg->discover_all_missing(*rctx.query_map); if (rctx.query_map->empty()) { string action; - if (pg->state_test(PG_STATE_BACKFILL)) { + if (pg->state_test(PG_STATE_BACKFILLING)) { auto evt = PG::CephPeeringEvtRef(new PG::CephPeeringEvt( queued, queued, diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3c9b7417d642a..36d0aabfa8f52 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6395,7 +6395,7 @@ PG::RecoveryState::Backfilling::Backfilling(my_context ctx) pg->queue_recovery(); pg->state_clear(PG_STATE_BACKFILL_TOOFULL); pg->state_clear(PG_STATE_BACKFILL_WAIT); - pg->state_set(PG_STATE_BACKFILL); + pg->state_set(PG_STATE_BACKFILLING); pg->publish_stats_to_osd(); } @@ -6407,7 +6407,7 @@ PG::RecoveryState::Backfilling::react(const DeferBackfill &c) pg->osd->local_reserver.cancel_reservation(pg->info.pgid); pg->state_set(PG_STATE_BACKFILL_WAIT); - pg->state_clear(PG_STATE_BACKFILL); + pg->state_clear(PG_STATE_BACKFILLING); for (set::iterator it = pg->backfill_targets.begin(); it != pg->backfill_targets.end(); @@ -6467,7 +6467,7 @@ void PG::RecoveryState::Backfilling::exit() PG *pg = context< RecoveryMachine >().pg; pg->backfill_reserved = false; pg->backfill_reserving = false; - pg->state_clear(PG_STATE_BACKFILL); + pg->state_clear(PG_STATE_BACKFILLING); pg->state_clear(PG_STATE_FORCED_BACKFILL | PG_STATE_FORCED_RECOVERY); utime_t dur = ceph_clock_now() - enter_time; pg->osd->recoverystate_perf->tinc(rs_backfilling_latency, dur); diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 2877c28d67a61..2038ac300487a 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -717,7 +717,7 @@ void PrimaryLogPG::maybe_force_recovery() if (!is_degraded() && !state_test(PG_STATE_RECOVERING | PG_STATE_RECOVERY_WAIT | - PG_STATE_BACKFILL | + PG_STATE_BACKFILLING | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILL_TOOFULL)) return; @@ -1553,7 +1553,7 @@ void PrimaryLogPG::calc_trim_to() if (is_degraded() || state_test(PG_STATE_RECOVERING | PG_STATE_RECOVERY_WAIT | - PG_STATE_BACKFILL | + PG_STATE_BACKFILLING | PG_STATE_BACKFILL_WAIT | PG_STATE_BACKFILL_TOOFULL)) { target = cct->_conf->osd_max_pg_log_entries; @@ -11313,7 +11313,7 @@ bool PrimaryLogPG::start_recovery_ops( assert(is_primary()); if (!state_test(PG_STATE_RECOVERING) && - !state_test(PG_STATE_BACKFILL)) { + !state_test(PG_STATE_BACKFILLING)) { /* TODO: I think this case is broken and will make do_recovery() * unhappy since we're returning false */ dout(10) << "recovery raced and were queued twice, ignoring!" << dendl; @@ -11348,7 +11348,7 @@ bool PrimaryLogPG::start_recovery_ops( bool deferred_backfill = false; if (recovering.empty() && - state_test(PG_STATE_BACKFILL) && + state_test(PG_STATE_BACKFILLING) && !backfill_targets.empty() && started < max && missing.num_missing() == 0 && waiting_on_backfill.empty()) { @@ -11437,7 +11437,7 @@ bool PrimaryLogPG::start_recovery_ops( AllReplicasRecovered()))); } } else { // backfilling - state_clear(PG_STATE_BACKFILL); + state_clear(PG_STATE_BACKFILLING); state_clear(PG_STATE_FORCED_BACKFILL); state_clear(PG_STATE_FORCED_RECOVERY); dout(10) << "recovery done, backfill done" << dendl; diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 22939c857a9bf..078314960f640 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -829,7 +829,7 @@ std::string pg_state_string(int state) oss << "repair+"; if (state & PG_STATE_BACKFILL_WAIT) oss << "backfill_wait+"; - if (state & PG_STATE_BACKFILL) + if (state & PG_STATE_BACKFILLING) oss << "backfilling+"; if (state & PG_STATE_FORCED_BACKFILL) oss << "forced_backfill+"; @@ -887,7 +887,7 @@ int pg_string_state(const std::string& state) else if (state == "deep_scrub") type = PG_STATE_DEEP_SCRUB; else if (state == "backfilling") - type = PG_STATE_BACKFILL; + type = PG_STATE_BACKFILLING; else if (state == "forced_backfill") type = PG_STATE_FORCED_BACKFILL; else if (state == "backfill_toofull") diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 43d9a98e73753..17f825cfd90ff 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -986,7 +986,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) { #define PG_STATE_STALE (1<<17) // our state for this pg is stale, unknown. #define PG_STATE_REMAPPED (1<<18) // pg is explicitly remapped to different OSDs than CRUSH #define PG_STATE_DEEP_SCRUB (1<<19) // deep scrub: check CRC32 on files -#define PG_STATE_BACKFILL (1<<20) // [active] backfilling pg content +#define PG_STATE_BACKFILLING (1<<20) // [active] backfilling pg content #define PG_STATE_BACKFILL_TOOFULL (1<<21) // backfill can't proceed: too full #define PG_STATE_RECOVERY_WAIT (1<<22) // waiting for recovery reservations #define PG_STATE_UNDERSIZED (1<<23) // pg acting < pool size -- 2.39.5