From: Samuel Just Date: Wed, 19 Feb 2014 00:08:12 +0000 (-0800) Subject: PG: insert into stray set if !us_up() && !is_acting() X-Git-Tag: v0.78~155 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=314116e2501ab076c1bff20b36c0337bf9405460;p=ceph.git PG: insert into stray set if !us_up() && !is_acting() This is simpler than checking actingbackfill since it may not yet be filled in. Fixes: #7470 Signed-off-by: Samuel Just Reviewed-by: Greg Farnum --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 47c57d2a62a..bfb48feb880 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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::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 diff --git a/src/osd/PG.h b/src/osd/PG.h index 3226b25657e..df189fa317a 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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;