]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSDMap: consolidate into clean_temps
authorSage Weil <sage@redhat.com>
Tue, 10 May 2016 14:22:32 +0000 (10:22 -0400)
committerSage Weil <sage@redhat.com>
Thu, 12 May 2016 13:59:30 +0000 (09:59 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h
src/test/osd/TestOSDMap.cc

index 8c16bb76f1e336e7602060866cccbe60c234a4c7..17cc12d84e73e0babff53238b4e2d61a4234c10c 100644 (file)
@@ -1003,11 +1003,9 @@ void OSDMonitor::create_pending()
 
   dout(10) << "create_pending e " << pending_inc.epoch << dendl;
 
-  // drop any redundant pg_temp entries
-  OSDMap::remove_redundant_temporaries(g_ceph_context, osdmap, &pending_inc);
-
-  // drop any pg or primary_temp entries with no up entries
-  OSDMap::remove_down_temps(g_ceph_context, osdmap, &pending_inc);
+  // clean up pg_temp, primary_temp
+  OSDMap::clean_temps(g_ceph_context, osdmap, &pending_inc);
+  dout(10) << "create_pending  did clean_temps" << dendl;
 }
 
 void OSDMonitor::maybe_prime_pg_temp()
index 07a963ccd5a68dec4c1a210eb009c74472f7e39a..a6fcd3810b0fe252de497a6c5d2da6fdff077363 100644 (file)
@@ -1175,14 +1175,8 @@ void OSDMap::dedup(const OSDMap *o, OSDMap *n)
     n->osd_uuid = o->osd_uuid;
 }
 
-void OSDMap::remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap,
-                                         OSDMap::Incremental *pending_inc)
-{
-  ldout(cct, 10) << "remove_redundant_temporaries" << dendl;
-}
-
-void OSDMap::remove_down_temps(CephContext *cct,
-                               const OSDMap& osdmap, Incremental *pending_inc)
+void OSDMap::clean_temps(CephContext *cct,
+                        const OSDMap& osdmap, Incremental *pending_inc)
 {
   ldout(cct, 10) << __func__ << dendl;
   OSDMap tmpmap;
index 5b76e0ac31037bf6860888980b6f8190dc90c780..fe07ccf483114d7fd62cff947ff5aaa316c43b64 100644 (file)
@@ -575,10 +575,8 @@ public:
   /// try to re-use/reference addrs in oldmap from newmap
   static void dedup(const OSDMap *oldmap, OSDMap *newmap);
 
-  static void remove_redundant_temporaries(CephContext *cct, const OSDMap& osdmap,
-                                          Incremental *pending_inc);
-  static void remove_down_temps(CephContext *cct, const OSDMap& osdmap,
-                                Incremental *pending_inc);
+  static void clean_temps(CephContext *cct, const OSDMap& osdmap,
+                         Incremental *pending_inc);
 
   // serialize, unserialize
 private:
index 0b50b32858ce217242edbf67d2d1cb498007e100..7723cb620687b1b171ba81f2f6a593144419379e 100644 (file)
@@ -250,7 +250,7 @@ TEST_F(OSDMapTest, PrimaryTempRespected) {
   EXPECT_EQ(acting_primary, acting_osds[1]);
 }
 
-TEST_F(OSDMapTest, RemovesRedundantTemps) {
+TEST_F(OSDMapTest, CleanTemps) {
   set_up_map();
 
   pg_t rawpg(0, 0, -1);
@@ -268,7 +268,7 @@ TEST_F(OSDMapTest, RemovesRedundantTemps) {
   osdmap.apply_incremental(pgtemp_map);
 
   OSDMap::Incremental pending_inc(osdmap.get_epoch() + 1);
-  OSDMap::remove_redundant_temporaries(g_ceph_context, osdmap, &pending_inc);
+  OSDMap::clean_temps(g_ceph_context, osdmap, &pending_inc);
 
   EXPECT_TRUE(pending_inc.new_pg_temp.count(pgid) &&
              pending_inc.new_pg_temp[pgid].size() == 0);
@@ -314,7 +314,7 @@ TEST_F(OSDMapTest, KeepsNecessaryTemps) {
 
   OSDMap::Incremental pending_inc(osdmap.get_epoch() + 1);
 
-  OSDMap::remove_redundant_temporaries(g_ceph_context, osdmap, &pending_inc);
+  OSDMap::clean_temps(g_ceph_context, osdmap, &pending_inc);
   EXPECT_FALSE(pending_inc.new_pg_temp.count(pgid));
   EXPECT_FALSE(pending_inc.new_primary_temp.count(pgid));
 }