From 4015343f270d18019f281ecd4731d593e602a1b0 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 10 Sep 2012 09:25:07 -0700 Subject: [PATCH] PG,osd_types,PGMonitor: make backfill state names more descriptive PG_STATE_BACKFILL->PG_STATE_BACKFILL_WAIT and PG_STATE_BACKFILLING->PG_STATE_BACKFILL backfill -> wait_backfill backfill+backfilling -> backfill Signed-off-by: Samuel Just --- src/mon/PGMonitor.cc | 8 ++++---- src/osd/PG.cc | 14 +++++++------- src/osd/osd_types.cc | 5 +++-- src/osd/osd_types.h | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 5edf24d6650..30ada2f95a5 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -1224,9 +1224,9 @@ void PGMonitor::get_health(list >& summary, note["recovering"] += p->second; if (p->first & PG_STATE_INCOMPLETE) note["incomplete"] += p->second; - if (p->first & PG_STATE_BACKFILL) + if (p->first & PG_STATE_BACKFILL_WAIT) note["backfill"] += p->second; - if (p->first & PG_STATE_BACKFILLING) + if (p->first & PG_STATE_BACKFILL) note["backfilling"] += p->second; } @@ -1276,8 +1276,8 @@ void PGMonitor::get_health(list >& summary, PG_STATE_SPLITTING | PG_STATE_RECOVERING | PG_STATE_INCOMPLETE | - PG_STATE_BACKFILL | - PG_STATE_BACKFILLING) && + PG_STATE_BACKFILL_WAIT | + PG_STATE_BACKFILL) && stuck_pgs.count(p->first) == 0) { ostringstream ss; ss << "pg " << p->first << " is " << pg_state_string(p->second.state); diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3ca74b43f6a..1861130c65f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1478,7 +1478,7 @@ void PG::activate(ObjectStore::Transaction& t, m->past_intervals = past_intervals; if (pi.last_backfill != hobject_t::get_max()) - state_set(PG_STATE_BACKFILL); + state_set(PG_STATE_BACKFILL_WAIT); else active++; @@ -1670,7 +1670,7 @@ void PG::all_activated_and_committed() // make sure CLEAN is marked if we've been clean in this interval if (info.last_complete == info.last_update && - !state_test(PG_STATE_BACKFILL) && + !state_test(PG_STATE_BACKFILL_WAIT) && !state_test(PG_STATE_RECOVERING)) { mark_clean(); } @@ -1733,7 +1733,7 @@ void PG::finish_recovery(ObjectStore::Transaction& t, list& tfin) dout(10) << "finish_recovery" << dendl; assert(info.last_complete == info.last_update); - state_clear(PG_STATE_BACKFILL); + state_clear(PG_STATE_BACKFILL_WAIT); state_clear(PG_STATE_RECOVERING); // only mark CLEAN if last_epoch_started is already stable. @@ -5080,7 +5080,7 @@ PG::RecoveryState::Backfilling::Backfilling(my_context ctx) PG *pg = context< RecoveryMachine >().pg; pg->backfill_reserved = true; pg->osd->queue_for_recovery(pg); - pg->state_set(PG_STATE_BACKFILLING); + pg->state_set(PG_STATE_BACKFILL); } void PG::RecoveryState::Backfilling::exit() @@ -5090,7 +5090,7 @@ void PG::RecoveryState::Backfilling::exit() pg->backfill_reserved = false; pg->backfill_reserving = false; pg->osd->local_reserver.cancel_reservation(pg->info.pgid); - pg->state_clear(PG_STATE_BACKFILLING); + pg->state_clear(PG_STATE_BACKFILL); } /*--WaitRemoteBackfillReserved--*/ @@ -5383,7 +5383,7 @@ boost::statechart::result PG::RecoveryState::Active::react(const RecoveryComplet int newest_update_osd; - pg->state_clear(PG_STATE_BACKFILL); + pg->state_clear(PG_STATE_BACKFILL_WAIT); pg->state_clear(PG_STATE_RECOVERING); // if we finished backfill, all acting are active; recheck if @@ -5470,7 +5470,7 @@ void PG::RecoveryState::Active::exit() pg->backfill_reserved = false; pg->backfill_reserving = false; pg->state_clear(PG_STATE_DEGRADED); - pg->state_clear(PG_STATE_BACKFILL); + pg->state_clear(PG_STATE_BACKFILL_WAIT); pg->state_clear(PG_STATE_REPLAY); } diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 3631f9bd2d7..0fe106286f5 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -416,9 +416,10 @@ std::string pg_state_string(int state) oss << "peering+"; if (state & PG_STATE_REPAIR) oss << "repair+"; + if (state & PG_STATE_BACKFILL_WAIT && + !(state &PG_STATE_BACKFILL)) + oss << "wait_backfill+"; if (state & PG_STATE_BACKFILL) - oss << "backfill+"; - if (state & PG_STATE_BACKFILLING) oss << "backfilling+"; if (state & PG_STATE_INCOMPLETE) oss << "incomplete+"; diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 33ef8a01cd5..1f74a05c9c5 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -560,12 +560,12 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) { #define PG_STATE_PEERING (1<<12) // pg is (re)peering #define PG_STATE_REPAIR (1<<13) // pg should repair on next scrub #define PG_STATE_RECOVERING (1<<14) // pg is recovering/migrating objects -#define PG_STATE_BACKFILL (1<<15) // [active] reserving backfill +#define PG_STATE_BACKFILL_WAIT (1<<15) // [active] reserving backfill #define PG_STATE_INCOMPLETE (1<<16) // incomplete content, peering failed. #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_BACKFILLING (1<<20) // [active] backfilling pg content +#define PG_STATE_BACKFILL (1<<20) // [active] backfilling pg content std::string pg_state_string(int state);