]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: avoid most of handle_osd_map if there are no new maps in message
authorSage Weil <sage@newdream.net>
Mon, 2 Aug 2010 19:57:36 +0000 (12:57 -0700)
committerSage Weil <sage@newdream.net>
Mon, 2 Aug 2010 20:23:55 +0000 (13:23 -0700)
We don't want to take the time to flush things to disk and shut down all
the worker threads if there is nothing new in the osdmap update (as is
usually the case).

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/OSD.cc

index f6e9e0843a1045b4c9f5816a579a6732bc49aa09..40f199f1253f518c74d8389aef51fa4ac89cbeff 100644 (file)
@@ -2166,6 +2166,13 @@ void OSD::handle_osd_map(MOSDMap *m)
 
   state = STATE_ACTIVE;
 
+  // make sure there is something new, here, before we bother flushing the queues and such
+  if (m->get_last() <= osdmap->get_epoch()) {
+    dout(10) << " no new maps here, dropping" << dendl;
+    m->put();
+    return;
+  }
+
   // pause, requeue op queue
   //wait_for_no_ops();