From: Samuel Just Date: Wed, 29 Oct 2014 20:57:01 +0000 (-0700) Subject: osd/: add state PG_STATE_PEERED X-Git-Tag: v0.93~127^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aac4c255e251ec1d96630e91e48b8b60cbbb7993;p=ceph.git osd/: add state PG_STATE_PEERED We need a state to represent the pg state where we are below min_size, but trying to recover. Signed-off-by: Samuel Just --- diff --git a/doc/rados/operations/pg-states.rst b/doc/rados/operations/pg-states.rst index 8ba92ac02674..8da73bc6ef7d 100644 --- a/doc/rados/operations/pg-states.rst +++ b/doc/rados/operations/pg-states.rst @@ -57,11 +57,11 @@ map is ``active + clean``. full ratio. *Incomplete* - Ceph detects that a placement group is missing information about writes - that may have occurred, or does not have enough healthy copies to reach - the pool's configured min_size. If you see this state, try to start any - failed OSDs that may contain the needed information or temporarily adjust - min_size to allow recovery. + Ceph detects that a placement group is missing information about + writes that may have occurred, or does not have any healthy + copies. If you see this state, try to start any failed OSDs that may + contain the needed information or temporarily adjust min_size to + allow recovery. *Stale* The placement group is in an unknown state - the monitors have not received @@ -74,3 +74,7 @@ map is ``active + clean``. *Undersized* The placement group fewer copies than the configured pool replication level. +*Peered* + The placement group has peered, but cannot serve client IO due to not having + enough copies to reach the pool's configured min_size parameter. Recovery + may occur in this state, so the pg may heal up to min_size eventually. diff --git a/src/osd/PG.h b/src/osd/PG.h index 2c3b5d4a4963..9f9ef7438151 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -2080,6 +2080,9 @@ public: bool is_undersized() const { return state_test(PG_STATE_UNDERSIZED); } bool is_scrubbing() const { return state_test(PG_STATE_SCRUBBING); } + bool is_peered() const { + return state_test(PG_STATE_ACTIVE) || state_test(PG_STATE_PEERED); + } bool is_empty() const { return info.last_update == eversion_t(0,0); } diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc index 7a2a35f62d61..1eae98a1b141 100644 --- a/src/osd/osd_types.cc +++ b/src/osd/osd_types.cc @@ -744,6 +744,8 @@ std::string pg_state_string(int state) oss << "backfill_toofull+"; if (state & PG_STATE_INCOMPLETE) oss << "incomplete+"; + if (state & PG_STATE_PEERED) + oss << "peered+"; string ret(oss.str()); if (ret.length() > 0) ret.resize(ret.length() - 1); diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h index 14974b8d35f6..b729cd88fa22 100644 --- a/src/osd/osd_types.h +++ b/src/osd/osd_types.h @@ -768,6 +768,7 @@ inline ostream& operator<<(ostream& out, const osd_stat_t& s) { #define PG_STATE_RECOVERY_WAIT (1<<22) // waiting for recovery reservations #define PG_STATE_UNDERSIZED (1<<23) // pg acting < pool size #define PG_STATE_ACTIVATING (1<<24) // pg is peered but not yet active +#define PG_STATE_PEERED (1<<25) // peered, cannot go active, can recover std::string pg_state_string(int state);