osd: add PG_STATE_UNDERSIZED

This is a distinct concept from degraded.

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2014-07-01 18:08:33 -07:00
parent 6c0a213436
commit b037e47a36
3 changed files with 5 additions and 1 deletions

View File

@ -2054,6 +2054,7 @@ public:
bool is_replay() const { return state_test(PG_STATE_REPLAY); }
bool is_clean() const { return state_test(PG_STATE_CLEAN); }
bool is_degraded() const { return state_test(PG_STATE_DEGRADED); }
bool is_undersized() const { return state_test(PG_STATE_UNDERSIZED); }
bool is_scrubbing() const { return state_test(PG_STATE_SCRUBBING); }

View File

@ -669,6 +669,8 @@ std::string pg_state_string(int state)
oss << "replay+";
if (state & PG_STATE_SPLITTING)
oss << "splitting+";
if (state & PG_STATE_UNDERSIZED)
oss << "undersized+";
if (state & PG_STATE_DEGRADED)
oss << "degraded+";
if (state & PG_STATE_REMAPPED)

View File

@ -749,7 +749,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) {
#define PG_STATE_SPLITTING (1<<7) // i am splitting
#define PG_STATE_SCRUBBING (1<<8) // scrubbing
#define PG_STATE_SCRUBQ (1<<9) // queued for scrub
#define PG_STATE_DEGRADED (1<<10) // pg membership not complete
#define PG_STATE_DEGRADED (1<<10) // pg contains objects with reduced redundancy
#define PG_STATE_INCONSISTENT (1<<11) // pg replicas are inconsistent (but shouldn't be)
#define PG_STATE_PEERING (1<<12) // pg is (re)peering
#define PG_STATE_REPAIR (1<<13) // pg should repair on next scrub
@ -762,6 +762,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) {
#define PG_STATE_BACKFILL (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
std::string pg_state_string(int state);