]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make other send_incremental variant handle map discontinuity
authorSage Weil <sage@newdream.net>
Thu, 6 Oct 2011 23:10:10 +0000 (16:10 -0700)
committerSage Weil <sage@newdream.net>
Thu, 6 Oct 2011 23:17:14 +0000 (16:17 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index a25235bae9d12831cd34229137b9e3013fc6da29..7dc7d1bd433bdac85982389052ddac25e5c73ad9 100644 (file)
@@ -943,6 +943,18 @@ void OSDMonitor::send_incremental(PaxosServiceMessage *req, epoch_t first)
 {
   dout(5) << "send_incremental [" << first << ".." << osdmap.get_epoch() << "]"
          << " to " << req->get_orig_source_inst() << dendl;
+  if (first < paxos->get_first_committed()) {
+    first = paxos->get_first_committed();
+    bufferlist bl;
+    mon->store->get_bl_sn(bl, "osdmap_full", first);
+    dout(20) << "send_incremental starting with base full " << first << " " << bl.length() << " bytes" << dendl;
+    MOSDMap *m = new MOSDMap(osdmap.get_fsid());
+    m->oldest_map = paxos->get_first_committed();
+    m->newest_map = osdmap.get_epoch();
+    m->maps[first] = bl;
+    mon->send_reply(req, m);
+    return;
+  }
   MOSDMap *m = build_incremental(first, osdmap.get_epoch());
   m->oldest_map = paxos->get_first_committed();
   m->newest_map = osdmap.get_epoch();