summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-07-28 08:59:21 -0700
committerSamuel Just <sam.just@inktank.com>2013-08-26 14:14:24 -0700
commit65a10862feec199d14f17627d0c42fa7c85766fa (patch)
tree7b2138562ffd2859fff7f3d3fb7546577e3ab010
parentaceef04f7fd56935e691c7deb05f25ace653bb76 (diff)
downloadceph-65a10862feec199d14f17627d0c42fa7c85766fa.tar.gz
osd: get initial full map after a map gap
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> (cherry picked from commit a6cd9fea50a4bd7048a222617a2bfe0680f7a969)
-rw-r--r--src/osd/OSD.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc
index 00d114d753d..696bcf0c710 100644
--- a/src/osd/OSD.cc
+++ b/src/osd/OSD.cc
@@ -4212,13 +4212,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;
}