]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: get initial full map after a map gap
authorSage Weil <sage@inktank.com>
Sun, 28 Jul 2013 15:59:21 +0000 (08:59 -0700)
committerSage Weil <sage@inktank.com>
Mon, 29 Jul 2013 19:12:14 +0000 (12:12 -0700)
If there is a gap in our map history, get the full range of maps that
the mon has.  Make sure the first one is a full map.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/osd/OSD.cc

index 3fd818e04e3d6122bdd07db22f2b6e7d00f03d9a..a71c1e9af217e11183cc4fd0723638dfd6b54ddc 100644 (file)
@@ -4957,13 +4957,22 @@ void OSD::handle_osd_map(MOSDMap *m)
   if (first > osdmap->get_epoch() + 1) {
     dout(10) << "handle_osd_map message skips epochs " << osdmap->get_epoch() + 1
             << ".." << (first-1) << dendl;
-    if ((m->oldest_map < first && osdmap->get_epoch() == 0) ||
-       m->oldest_map <= osdmap->get_epoch() + 1) {
+    if (m->oldest_map <= osdmap->get_epoch() + 1) {
       monc->sub_want("osdmap", osdmap->get_epoch()+1, CEPH_SUBSCRIBE_ONETIME);
       monc->renew_subs();
       m->put();
       return;
     }
+    // always try to get the full range of maps--as many as we can.  this
+    //  1- is good to have
+    //  2- is at present the only way to ensure that we get a *full* map as
+    //     the first map!
+    if (m->oldest_map < first) {
+      monc->sub_want("osdmap", m->oldest_map - 1, CEPH_SUBSCRIBE_ONETIME);
+      monc->renew_subs();
+      m->put();
+      return;
+    }
     skip_maps = true;
   }