From 31a34946f7aa0ad2b9848cbc808d209394a9ad44 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 --- src/mgr/DaemonServer.cc | 2 +- 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 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index e1321f0b2a045..e0b7c9f6f8c18 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -1181,7 +1181,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/osd/OSD.cc b/src/osd/OSD.cc index 8233eb030ca9e..cfb6ea7370d21 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -9066,7 +9066,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(); } @@ -9151,7 +9151,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 b30e8ec218b1b..5f53cc6ea12a2 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -6190,7 +6190,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(); } @@ -6202,7 +6202,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(); @@ -6262,7 +6262,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 563686dd010fe..48b31a407235c 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -715,7 +715,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; @@ -1551,7 +1551,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; @@ -11210,7 +11210,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; @@ -11245,7 +11245,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()) { @@ -11334,7 +11334,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 c4d69169820c3..c49afe8e79522 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 80f14402ab7e9..c7dd66124a874 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -993,7 +993,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