From: huangjun Date: Fri, 16 Dec 2016 08:58:14 +0000 (+0800) Subject: osd/PG: simplify the logic of backfill_targets checking X-Git-Tag: v12.0.0~377^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5915fb3506a7a01798980caadda2edc3189733bf;p=ceph.git osd/PG: simplify the logic of backfill_targets checking the final state is backfill_targets equals want_backfill, and backfill shards should not included in stray_set. Signed-off-by: huangjun --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index b12e099614c1..3db754ed4b2c 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1447,20 +1447,13 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, bool *history_les_bound) if (backfill_targets.empty()) { // Caller is GetInfo backfill_targets = want_backfill; - for (set::iterator i = backfill_targets.begin(); - i != backfill_targets.end(); - ++i) { - assert(!stray_set.count(*i)); - } - } else { - // Will not change if already set because up would have had to change - assert(backfill_targets == want_backfill); - // Verify that nothing in backfill is in stray_set - for (set::iterator i = want_backfill.begin(); - i != want_backfill.end(); - ++i) { - assert(stray_set.find(*i) == stray_set.end()); - } + } + // Will not change if already set because up would have had to change + // Verify that nothing in backfill is in stray_set + for (set::iterator i = want_backfill.begin(); + i != want_backfill.end(); + ++i) { + assert(stray_set.find(*i) == stray_set.end()); } dout(10) << "choose_acting want " << want << " (== acting) backfill_targets " << want_backfill << dendl;