]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: implement remove_down_primary_temp()
authorGreg Farnum <greg@inktank.com>
Thu, 19 Dec 2013 01:40:11 +0000 (17:40 -0800)
committerGreg Farnum <greg@inktank.com>
Thu, 16 Jan 2014 00:33:06 +0000 (16:33 -0800)
Same as remove_down_pg_temp()

Signed-off-by: Greg Farnum <greg@inktank.com>
src/mon/OSDMonitor.cc
src/mon/OSDMonitor.h

index c8623cd206ec1812da9c33721d82c03e177be299..3a704c38d6e08f660f779f397252285a5fdd28b9 100644 (file)
@@ -470,6 +470,20 @@ void OSDMonitor::remove_down_pg_temp()
   }
 }
 
+void OSDMonitor::remove_down_primary_temp()
+{
+  dout(10) << "remove_down_primary_temp" << dendl;
+  OSDMap tmpmap(osdmap);
+  tmpmap.apply_incremental(pending_inc);
+
+  for (map<pg_t,int>::iterator p = tmpmap.primary_temp->begin();
+      p != tmpmap.primary_temp->end();
+      ++p) {
+    if (tmpmap.is_down(p->second))
+      pending_inc.new_primary_temp[p->first] = -1;
+  }
+}
+
 /* Assign a lower weight to overloaded OSDs.
  *
  * The osds that will get a lower weight are those with with a utilization
@@ -560,8 +574,9 @@ void OSDMonitor::create_pending()
   // drop any redundant pg_temp entries
   remove_redundant_pg_temp();
 
-  // drop any pg_temp entries with no up entries
+  // drop any pg or primary_temp entries with no up entries
   remove_down_pg_temp();
+  remove_down_primary_temp();
 }
 
 /**
index 90ce6eb56335c957a9d796265ca1449e6d8887cb..ec49c609f716c8c609fe918e60909c47257fcb9a 100644 (file)
@@ -206,6 +206,7 @@ private:
 
   void remove_redundant_pg_temp();
   void remove_down_pg_temp();
+  void remove_down_primary_temp();
   int reweight_by_utilization(int oload, std::string& out_str);
 
   bool check_source(PaxosServiceMessage *m, uuid_d fsid);