]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/OSD.cc: finish full_map_request every MOSDMap message. 8147/head
authorXiaoxi Chen <xiaoxchen@ebay.com>
Wed, 16 Mar 2016 08:13:28 +0000 (01:13 -0700)
committerXiaoxi Chen <xiaoxchen@ebay.com>
Wed, 23 Mar 2016 09:03:15 +0000 (02:03 -0700)
We remember the range of requested full map in requested_full_first/last
and prevent sending duplicate requests.

But monitor will cap the reply to osd_map_message_max number of maps, for example,
OSD request [100, 200] while monitor only return [100,149], previous code think
[150, 200] is dup and prevent the OSD to send out the request, which is wrong.

Fix this by clear the requested_full_first/last field at the end of handle_osd_map.

Fixes: #15130
Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
src/osd/OSD.cc
src/osd/OSD.h

index 298d65df454f192cc6881f72d06bd279dfb019cb..6cf2bd2b983c48c3ec88135527b3747ec6a99bd1 100644 (file)
@@ -4933,6 +4933,17 @@ void OSD::request_full_map(epoch_t first, epoch_t last)
   monc->send_mon_message(req);
 }
 
+void OSD::finish_full_map_request()
+{
+  if (requested_full_first == 0 && requested_full_last == 0)
+    return;
+  //Had requested some map but didn't receive in this message,
+  //This might because monitor capping the message to osd_map_message_max
+  dout(10) << __func__ << "still missing " << requested_full_first
+          << ".." << requested_full_last << ", but now give up." << dendl;
+  requested_full_first = requested_full_last = 0;
+}
+
 void OSD::got_full_map(epoch_t e)
 {
   assert(requested_full_first <= requested_full_last);
@@ -6706,6 +6717,9 @@ void OSD::handle_osd_map(MOSDMap *m)
   // even if this map isn't from a mon, we may have satisfied our subscription
   monc->sub_got("osdmap", last);
 
+  if (!m->maps.empty())
+    finish_full_map_request();
+
   if (last <= superblock.newest_map) {
     dout(10) << " no new maps here, dropping" << dendl;
     m->put();
index d6a8d2dd7ad5308a138393b21b90468f9f9a9e50..834e56acad30df3a3edb8f8e03d9daf6b6513ede 100644 (file)
@@ -2052,6 +2052,7 @@ protected:
   epoch_t requested_full_first, requested_full_last;
 
   void request_full_map(epoch_t first, epoch_t last);
+  void finish_full_map_request();
   void got_full_map(epoch_t e);
 
   // -- failures --