]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd_types: remove the pool_id argument from (is|check)_new_interval 1804/head
authorSamuel Just <sam.just@inktank.com>
Wed, 14 May 2014 20:16:45 +0000 (13:16 -0700)
committerSamuel Just <sam.just@inktank.com>
Wed, 14 May 2014 20:17:12 +0000 (13:17 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc
src/osd/PG.cc
src/osd/osd_types.cc
src/osd/osd_types.h
src/test/osd/types.cc

index 220eac652723e8ee5e3968b27b6cfe41257afa59..434e654f057a83acca805221dbbfe7c67be0270f 100644 (file)
@@ -2316,7 +2316,6 @@ void OSD::build_past_intervals_parallel()
        p.same_interval_since,
        pg->info.history.last_epoch_clean,
        cur_map, last_map,
-       pg->info.pgid.pool(),
        pg->info.pgid.pgid,
        &pg->past_intervals,
        &debug);
index 3cbea636d34f4813f3cb928afa93ec4be1a1c37c..cc00a89931e0c670b5de9b0762cbee4b7d3cf1dd 100644 (file)
@@ -675,7 +675,6 @@ void PG::generate_past_intervals()
       info.history.last_epoch_clean,
       cur_map,
       last_map,
-      pgid.pool(),
       pgid,
       &past_intervals,
       &debug);
@@ -4571,7 +4570,6 @@ bool PG::should_restart_peering(
        newup,
        osdmap,
        lastmap,
-       info.pgid.pool(),
        info.pgid.pgid)) {
     dout(20) << "new interval newup " << newup
             << " newacting " << newacting << dendl;
@@ -4704,7 +4702,6 @@ void PG::start_peering_interval(
       info.history.last_epoch_clean,
       osdmap,
       lastmap,
-      info.pgid.pool(),
       info.pgid.pgid,
       &past_intervals,
       &debug);
index 6bdbd6119326878d1a236511eebd070c2cbdd83d..f9605d8944e6c25483a9e9bd197ea98ccf39c71e 100644 (file)
@@ -2197,15 +2197,14 @@ bool pg_interval_t::is_new_interval(
   const vector<int> &new_up,
   OSDMapRef osdmap,
   OSDMapRef lastmap,
-  int64_t pool_id,
   pg_t pgid) {
   return old_acting_primary != new_acting_primary ||
     new_acting != old_acting ||
     old_up_primary != new_up_primary ||
     new_up != old_up ||
-    (!(lastmap->get_pools().count(pool_id))) ||
-    (lastmap->get_pools().find(pool_id)->second.min_size !=
-     osdmap->get_pools().find(pool_id)->second.min_size)  ||
+    (!(lastmap->get_pools().count(pgid.pool()))) ||
+    (lastmap->get_pools().find(pgid.pool())->second.min_size !=
+     osdmap->get_pools().find(pgid.pool())->second.min_size)  ||
     pgid.is_split(lastmap->get_pg_num(pgid.pool()),
                  osdmap->get_pg_num(pgid.pool()), 0);
 }
@@ -2223,7 +2222,6 @@ bool pg_interval_t::check_new_interval(
   epoch_t last_epoch_clean,
   OSDMapRef osdmap,
   OSDMapRef lastmap,
-  int64_t pool_id,
   pg_t pgid,
   map<epoch_t, pg_interval_t> *past_intervals,
   std::ostream *out)
@@ -2243,7 +2241,6 @@ bool pg_interval_t::check_new_interval(
        new_up,
        osdmap,
        lastmap,
-       pool_id,
        pgid)) {
     pg_interval_t& i = (*past_intervals)[same_interval_since];
     i.first = same_interval_since;
@@ -2255,7 +2252,7 @@ bool pg_interval_t::check_new_interval(
 
     if (!i.acting.empty() && i.primary != -1 &&
        i.acting.size() >=
-       lastmap->get_pools().find(pool_id)->second.min_size) {
+       lastmap->get_pools().find(pgid.pool())->second.min_size) {
       if (out)
        *out << "generate_past_intervals " << i
             << ": not rw,"
index 67ece00c38df6265efdc0b0e821f5023024b93d8..f3529adbc66f3ac084e7325ef2c86596f36a2018 100644 (file)
@@ -1717,7 +1717,6 @@ struct pg_interval_t {
     const vector<int> &new_up,                  ///< [in] up as of osdmap
     ceph::shared_ptr<const OSDMap> osdmap,  ///< [in] current map
     ceph::shared_ptr<const OSDMap> lastmap, ///< [in] last map
-    int64_t poolid,                             ///< [in] pool for pg
     pg_t pgid                                   ///< [in] pgid for pg
     );
 
@@ -1738,7 +1737,6 @@ struct pg_interval_t {
     epoch_t last_epoch_clean,                   ///< [in] current
     ceph::shared_ptr<const OSDMap> osdmap,  ///< [in] current map
     ceph::shared_ptr<const OSDMap> lastmap, ///< [in] last map
-    int64_t poolid,                             ///< [in] pool for pg
     pg_t pgid,                                  ///< [in] pgid for pg
     map<epoch_t, pg_interval_t> *past_intervals,///< [out] intervals
     ostream *out = 0                            ///< [out] debug ostream
index a04f2cba6132404f05b4c4428eca9a4ba8b3a436..14935d8c66efdd2712499a77e5631cba52019eb0 100644 (file)
@@ -182,7 +182,6 @@ TEST(pg_interval_t, check_new_interval)
                                                   last_epoch_clean,
                                                   osdmap,
                                                   lastmap,
-                                                  pool_id,
                                                   pgid,
                                                   &past_intervals));
     ASSERT_TRUE(past_intervals.empty());
@@ -212,7 +211,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     ASSERT_EQ((unsigned int)1, past_intervals.size());
@@ -245,7 +243,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     old_primary = new_primary;
@@ -279,7 +276,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     ASSERT_EQ((unsigned int)1, past_intervals.size());
@@ -311,7 +307,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     ASSERT_EQ((unsigned int)1, past_intervals.size());
@@ -350,7 +345,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     ASSERT_EQ((unsigned int)1, past_intervals.size());
@@ -389,7 +383,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals));
     ASSERT_EQ((unsigned int)1, past_intervals.size());
@@ -423,7 +416,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals,
                                                  &out));
@@ -475,7 +467,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals,
                                                  &out));
@@ -510,7 +501,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals,
                                                  &out));
@@ -555,7 +545,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals,
                                                  &out));
@@ -604,7 +593,6 @@ TEST(pg_interval_t, check_new_interval)
                                                  last_epoch_clean,
                                                  osdmap,
                                                  lastmap,
-                                                 pool_id,
                                                  pgid,
                                                  &past_intervals,
                                                  &out));