]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PG: insert into stray set if !us_up() && !is_acting()
authorSamuel Just <sam.just@inktank.com>
Wed, 19 Feb 2014 00:08:12 +0000 (16:08 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 19 Feb 2014 06:20:40 +0000 (22:20 -0800)
This is simpler than checking actingbackfill
since it may not yet be filled in.

Fixes: #7470
Signed-off-by: Samuel Just <sam.just@inktank.com>
Reviewed-by: Greg Farnum <greg@inktank.com>
src/osd/PG.cc
src/osd/PG.h

index 47c57d2a62a0427d261c0290234b44d4e1ba247f..bfb48feb880e80f4da47ce73359c1b1a105b42cc 100644 (file)
@@ -296,8 +296,7 @@ bool PG::proc_replica_info(pg_shard_t from, const pg_info_t &oinfo)
   reg_next_scrub();
   
   // stray?
-  if ((!is_active() && !is_acting(from)) ||
-      (is_active() && !is_actingbackfill(from))) {
+  if (!is_up(from) && !is_acting(from)) {
     dout(10) << " osd." << from << " has stray content: " << oinfo << dendl;
     stray_set.insert(from);
     if (is_clean()) {
@@ -1303,7 +1302,7 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id)
     for (set<pg_shard_t>::iterator i = backfill_targets.begin();
         i != backfill_targets.end();
         ++i) {
-      stray_set.erase(*i);
+      assert(!stray_set.count(*i));
     }
   } else {
     // Will not change if already set because up would have had to change
index 3226b25657ede930a85f1832af62e8b9302214a6..df189fa317a1b80b077a36ee22ecc77633ea147f 100644 (file)
@@ -688,6 +688,13 @@ public:
       return std::find(acting.begin(), acting.end(), osd.osd) != acting.end();
     }
   }
+  bool is_up(pg_shard_t osd) const {
+    if (pool.info.ec_pool()) {
+      return up.size() > osd.shard && up[osd.shard] == osd.osd;
+    } else {
+      return std::find(up.begin(), up.end(), osd.osd) != up.end();
+    }
+  }
   
   bool needs_recovery() const;
   bool needs_backfill() const;