From: Sage Weil Date: Sat, 14 Nov 2015 17:57:05 +0000 (-0500) Subject: osd: reduce mon_subscribe messages X-Git-Tag: v10.0.1~26^2~14 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=160a0205c1a74ab594c5914cda54c85af6832900;p=ceph.git osd: reduce mon_subscribe messages 1. MonClient remembers our subscriptions; only indicate we want osd_pg_creates once, in init. 2. We don't need to re-request the latest osdmap each time we reconnect. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 9a09a2b8fd4..2f6a0dd49de 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2007,6 +2007,15 @@ int OSD::init() peering_wq.drain(); dout(0) << "done with init, starting boot process" << dendl; + + // subscribe to any pg creations + monc->sub_want("osd_pg_creates", last_pg_create_epoch, 0); + + // we don't need to ask for an osdmap here; objecter will + //monc->sub_want("osdmap", osdmap->get_epoch(), CEPH_SUBSCRIBE_ONETIME); + + monc->renew_subs(); + start_boot(); return 0; @@ -4434,10 +4443,6 @@ void OSD::ms_handle_connect(Connection *con) send_pg_stats(now); map_lock.put_read(); - - monc->sub_want("osd_pg_creates", last_pg_create_epoch, 0); - monc->sub_want("osdmap", osdmap->get_epoch(), CEPH_SUBSCRIBE_ONETIME); - monc->renew_subs(); } // full map requests may happen while active or pre-boot