]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/: add state PG_STATE_PEERED
authorSamuel Just <sam.just@inktank.com>
Wed, 29 Oct 2014 20:57:01 +0000 (13:57 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 30 Jan 2015 19:45:37 +0000 (11:45 -0800)
We need a state to represent the pg state where we are below
min_size, but trying to recover.

Signed-off-by: Samuel Just <sam.just@inktank.com>
doc/rados/operations/pg-states.rst
src/osd/PG.h
src/osd/osd_types.cc
src/osd/osd_types.h

index 8ba92ac02674456e0f6dfe9d09defac33f97945b..8da73bc6ef7d1218f8cb8f7cf3065c3e87659dd5 100644 (file)
@@ -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.
index 2c3b5d4a49635ede4600d5ab42573900c0d61b7c..9f9ef7438151dff33ee0a7daf22e8ffbc191558f 100644 (file)
@@ -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); }
 
index 7a2a35f62d61b7aeafb2feffd4b8f17215a710f0..1eae98a1b1416c2c959340c512b1dbdcc1b46d32 100644 (file)
@@ -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);
index 14974b8d35f648a98e54bf213b1a5f40262f1752..b729cd88fa22d03e0ba1d98eb98e4169303f6530 100644 (file)
@@ -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);