]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: subscribe to all pg creates, not just once on start
authorSage Weil <sage@redhat.com>
Wed, 7 Oct 2015 00:48:38 +0000 (20:48 -0400)
committerSage Weil <sage@redhat.com>
Mon, 23 Nov 2015 13:38:49 +0000 (08:38 -0500)
We want to know about all future pg creations, not just those pending
when we start.  (This only helps once the mon knows how to do this...)

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h

index 85fee628da327203d94b923f35b79de257b8b068..9a09a2b8fd4abaf52af80e6ee42407c94a6e7c54 100644 (file)
@@ -1597,6 +1597,7 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
     &osd_tp),
   map_lock("OSD::map_lock"),
   pg_map_lock("OSD::pg_map_lock"),
+  last_pg_create_epoch(0),
   debug_drop_pg_create_probability(cct->_conf->osd_debug_drop_pg_create_probability),
   debug_drop_pg_create_duration(cct->_conf->osd_debug_drop_pg_create_duration),
   debug_drop_pg_create_left(-1),
@@ -4434,7 +4435,7 @@ void OSD::ms_handle_connect(Connection *con)
 
       map_lock.put_read();
 
-      monc->sub_want("osd_pg_creates", 0, CEPH_SUBSCRIBE_ONETIME);
+      monc->sub_want("osd_pg_creates", last_pg_create_epoch, 0);
       monc->sub_want("osdmap", osdmap->get_epoch(), CEPH_SUBSCRIBE_ONETIME);
       monc->renew_subs();
     }
@@ -7309,6 +7310,8 @@ void OSD::handle_pg_create(OpRequestRef op)
     dispatch_context(rctx, pg, osdmap);
   }
 
+  last_pg_create_epoch = m->epoch;
+
   maybe_update_heartbeat_peers();
 }
 
index 82bb8be2063ed2409122057394eb7dba6d4d6e90..7ee15a75f93268cedb9c77e86e6993128662a5b0 100644 (file)
@@ -1952,6 +1952,7 @@ protected:
     pg_t parent;
   };
   ceph::unordered_map<spg_t, create_pg_info> creating_pgs;
+  epoch_t last_pg_create_epoch;
   double debug_drop_pg_create_probability;
   int debug_drop_pg_create_duration;
   int debug_drop_pg_create_left;  // 0 if we just dropped the last one, -1 if we can drop more