]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: reduce mon_subscribe messages
authorSage Weil <sage@redhat.com>
Sat, 14 Nov 2015 17:57:05 +0000 (12:57 -0500)
committerSage Weil <sage@redhat.com>
Mon, 23 Nov 2015 13:38:50 +0000 (08:38 -0500)
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 <sage@redhat.com>
src/osd/OSD.cc

index 9a09a2b8fd4abaf52af80e6ee42407c94a6e7c54..2f6a0dd49def7db85f3a2a80bdfc7426319555d2 100644 (file)
@@ -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