From: xie xingguo Date: Thu, 19 Oct 2017 07:32:53 +0000 (+0800) Subject: osd/PG: drop want_primary from calc_replicated[ec]_acting X-Git-Tag: v13.0.1~422^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=5fc46a619ab9c26e3dd8a5e8987e436072f9ad68;p=ceph.git osd/PG: drop want_primary from calc_replicated[ec]_acting This is generally not necessary because the first valid osd in want set will be chosen as primary! Signed-off-by: xie xingguo --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 325290d8ab5..f5f0187b95f 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1131,7 +1131,6 @@ void PG::calc_ec_acting( vector *_want, set *backfill, set *acting_backfill, - pg_shard_t *want_primary, ostream &ss) { vector want(size, CRUSH_ITEM_NONE); @@ -1181,14 +1180,9 @@ void PG::calc_ec_acting( } } - bool found_primary = false; for (uint8_t i = 0; i < want.size(); ++i) { if (want[i] != CRUSH_ITEM_NONE) { acting_backfill->insert(pg_shard_t(want[i], shard_id_t(i))); - if (!found_primary) { - *want_primary = pg_shard_t(want[i], shard_id_t(i)); - found_primary = true; - } } } acting_backfill->insert(backfill->begin(), backfill->end()); @@ -1213,7 +1207,6 @@ void PG::calc_replicated_acting( vector *want, set *backfill, set *acting_backfill, - pg_shard_t *want_primary, ostream &ss) { ss << "calc_acting newest update on osd." << auth_log_shard->first @@ -1238,7 +1231,6 @@ void PG::calc_replicated_acting( ss << "calc_acting primary is osd." << primary->first << " with " << primary->second << std::endl; - *want_primary = primary->first; want->push_back(primary->first.osd); acting_backfill->insert(primary->first); unsigned usable = 1; @@ -1385,7 +1377,6 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, set want_backfill, want_acting_backfill; vector want; - pg_shard_t want_primary; stringstream ss; if (!pool.info.is_erasure()) calc_replicated_acting( @@ -1399,7 +1390,6 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, &want, &want_backfill, &want_acting_backfill, - &want_primary, ss); else calc_ec_acting( @@ -1412,7 +1402,6 @@ bool PG::choose_acting(pg_shard_t &auth_log_shard_id, &want, &want_backfill, &want_acting_backfill, - &want_primary, ss); dout(10) << ss.str() << dendl; diff --git a/src/osd/PG.h b/src/osd/PG.h index 40e7c7c3be5..4f0c3ff7607 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1361,7 +1361,6 @@ protected: vector *want, set *backfill, set *acting_backfill, - pg_shard_t *want_primary, ostream &ss); static void calc_replicated_acting( map::const_iterator auth_log_shard, @@ -1374,7 +1373,6 @@ protected: vector *want, set *backfill, set *acting_backfill, - pg_shard_t *want_primary, ostream &ss); bool choose_acting(pg_shard_t &auth_log_shard, bool restrict_to_up_acting,