]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: maintain full mapping, synchronously
authorSage Weil <sage@redhat.com>
Mon, 30 Jan 2017 19:57:46 +0000 (14:57 -0500)
committerSage Weil <sage@redhat.com>
Thu, 16 Feb 2017 17:04:06 +0000 (12:04 -0500)
This is temporarily; we'll put this in an async, parallelized thread
shortly.

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

index df21c2d1c40435b8791c3a23dc2d7eece29132bb..a83f566cd76fcde4253aa0dc64d66ad491729086 100644 (file)
@@ -354,6 +354,12 @@ void OSDMonitor::on_active()
       ls.pop_front();
     }
   }
+
+  // FIXME: hacky synchronous blocking mapping update
+  utime_t start = ceph_clock_now();
+  mapping.update(osdmap);
+  utime_t end = ceph_clock_now();
+  dout(10) << __func__ << " updated mapping in " << (end - start) << dendl;
 }
 
 void OSDMonitor::on_shutdown()
index 2aa6a81bc9202675a835a36f365a3b4623b465f3..ece88880e6a9757c4d6f0f873e2a0472e354412d 100644 (file)
@@ -30,6 +30,7 @@ using namespace std;
 #include "msg/Messenger.h"
 
 #include "osd/OSDMap.h"
+#include "osd/OSDMapMapping.h"
 
 #include "PaxosService.h"
 
@@ -113,6 +114,7 @@ class OSDMonitor : public PaxosService {
   CephContext *cct;
 public:
   OSDMap osdmap;
+  OSDMapMapping mapping;
 
 private:
   // [leader]