From 4a7c3553a736832043d3ea4d5af1ef391008256d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 2 Aug 2010 12:57:36 -0700 Subject: [PATCH] osd: avoid most of handle_osd_map if there are no new maps in message 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 --- src/osd/OSD.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index f6e9e0843a104..40f199f1253f5 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(); -- 2.39.5