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 <sam.just@inktank.com>
This commit is contained in:
Samuel Just 2012-09-10 09:25:07 -07:00
parent 1fafd99c16
commit 4015343f27
4 changed files with 16 additions and 15 deletions

View File

@ -1224,9 +1224,9 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& 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<pair<health_status_t,string> >& 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);

View File

@ -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<Context*>& 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);
}

View File

@ -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+";

View File

@ -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);