]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMonitor: drop old creating_pgs_by_osd
authorSage Weil <sage@redhat.com>
Wed, 7 Oct 2015 04:39:41 +0000 (00:39 -0400)
committerSage Weil <sage@redhat.com>
Mon, 23 Nov 2015 13:38:50 +0000 (08:38 -0500)
Obsoleted by creating_pgs_by_osd_epoch.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc
src/mon/PGMap.h
src/mon/PGMonitor.cc

index 0f67ae7eb66249eb9ea9aa13c29268f6ce64cf25..6eb8b33d7995209f822f5eca41764378d2864d87 100644 (file)
@@ -472,7 +472,6 @@ void PGMap::stat_pg_add(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
     if (s.state & PG_STATE_CREATING) {
       creating_pgs.insert(pgid);
       if (s.acting_primary >= 0) {
-       creating_pgs_by_osd[s.acting_primary].insert(pgid);
        creating_pgs_by_osd_epoch[s.acting_primary][s.mapping_epoch].insert(pgid);
       }
     }
@@ -512,10 +511,6 @@ void PGMap::stat_pg_sub(const pg_t &pgid, const pg_stat_t &s, bool nocreating,
     if (s.state & PG_STATE_CREATING) {
       creating_pgs.erase(pgid);
       if (s.acting_primary >= 0) {
-       creating_pgs_by_osd[s.acting_primary].erase(pgid);
-       if (creating_pgs_by_osd[s.acting_primary].size() == 0)
-         creating_pgs_by_osd.erase(s.acting_primary);
-
        map<epoch_t,set<pg_t> >& r = creating_pgs_by_osd_epoch[s.acting_primary];
        r[s.mapping_epoch].erase(pgid);
        if (r[s.mapping_epoch].empty())
index 3a3824027accd3b9dc738d491a991a70d4748b2a..d2b9e8af1db13cabca7eba18732f38a5823acdc1 100644 (file)
@@ -182,7 +182,6 @@ public:
  public:
 
   set<pg_t> creating_pgs;
-  map<int,set<pg_t> > creating_pgs_by_osd;
   map<int,map<epoch_t,set<pg_t> > > creating_pgs_by_osd_epoch;
 
   // Bits that use to be enum StuckPG
index e9b892cb38f5f426212fcdc19cb5b492645f735c..51a91c156c9d329d899c23330e0df52a992fa788 100644 (file)
@@ -1135,10 +1135,6 @@ void PGMonitor::map_pg_creates()
        acting_primary != s->acting_primary) {
       changed = true;
       if (s->acting_primary != -1) {
-       pg_map.creating_pgs_by_osd[s->acting_primary].erase(pgid);
-       if (pg_map.creating_pgs_by_osd[s->acting_primary].size() == 0)
-         pg_map.creating_pgs_by_osd.erase(s->acting_primary);
-
        map<epoch_t,set<pg_t> >& r =
          pg_map.creating_pgs_by_osd_epoch[s->acting_primary];
        r[s->mapping_epoch].erase(pgid);
@@ -1167,7 +1163,6 @@ void PGMonitor::map_pg_creates()
       if (changed) {
        pg_map.creating_pgs_by_osd_epoch[acting_primary][s->mapping_epoch].insert(
           pgid);
-       pg_map.creating_pgs_by_osd[acting_primary].insert(pgid);
       }
     } else {
       dout(20) << "map_pg_creates  " << pgid << " -> no osds in epoch "
@@ -1175,12 +1170,6 @@ void PGMonitor::map_pg_creates()
       continue;  // blarney!
     }
   }
-  for (map<int, set<pg_t> >::iterator p = pg_map.creating_pgs_by_osd.begin();
-       p != pg_map.creating_pgs_by_osd.end();
-       ++p) {
-    dout(10) << "map_pg_creates osd." << p->first
-            << " has " << p->second.size() << " pgs" << dendl;
-  }
 }
 
 void PGMonitor::send_pg_creates()
@@ -1201,8 +1190,9 @@ void PGMonitor::send_pg_creates()
           << " pgs" << dendl;
 
   utime_t now = ceph_clock_now(g_ceph_context);
-  for (map<int, set<pg_t> >::iterator p = pg_map.creating_pgs_by_osd.begin();
-       p != pg_map.creating_pgs_by_osd.end();
+  for (map<int, map<epoch_t, set<pg_t>> >::iterator p =
+        pg_map.creating_pgs_by_osd_epoch.begin();
+       p != pg_map.creating_pgs_by_osd_epoch.end();
        ++p) {
     int osd = p->first;