]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: drop want_primary from calc_replicated[ec]_acting
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 19 Oct 2017 07:32:53 +0000 (15:32 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 21 Oct 2017 06:20:52 +0000 (14:20 +0800)
This is generally not necessary because the first valid
osd in want set will be chosen as primary!

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PG.cc
src/osd/PG.h

index 325290d8ab5eed72deb8c041d8a060b4a6799056..f5f0187b95f6c80a37e233ca2f435ad85eb07440 100644 (file)
@@ -1131,7 +1131,6 @@ void PG::calc_ec_acting(
   vector<int> *_want,
   set<pg_shard_t> *backfill,
   set<pg_shard_t> *acting_backfill,
-  pg_shard_t *want_primary,
   ostream &ss)
 {
   vector<int> 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<int> *want,
   set<pg_shard_t> *backfill,
   set<pg_shard_t> *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<pg_shard_t> want_backfill, want_acting_backfill;
   vector<int> 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;
 
index 40e7c7c3be5e33d85e6f86ab2ecfc257257b7d75..4f0c3ff7607267257a92ee69f51709dfc26c50f5 100644 (file)
@@ -1361,7 +1361,6 @@ protected:
     vector<int> *want,
     set<pg_shard_t> *backfill,
     set<pg_shard_t> *acting_backfill,
-    pg_shard_t *want_primary,
     ostream &ss);
   static void calc_replicated_acting(
     map<pg_shard_t, pg_info_t>::const_iterator auth_log_shard,
@@ -1374,7 +1373,6 @@ protected:
     vector<int> *want,
     set<pg_shard_t> *backfill,
     set<pg_shard_t> *acting_backfill,
-    pg_shard_t *want_primary,
     ostream &ss);
   bool choose_acting(pg_shard_t &auth_log_shard,
                     bool restrict_to_up_acting,