From: Sage Weil Date: Wed, 7 Oct 2015 00:48:38 +0000 (-0400) Subject: osd: subscribe to all pg creates, not just once on start X-Git-Tag: v10.0.1~26^2~20 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d3eba9b0afe6cf2085ee5704ce7d1eb03c580ad9;p=ceph.git osd: subscribe to all pg creates, not just once on start 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 --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 85fee628da32..9a09a2b8fd4a 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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(); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 82bb8be2063e..7ee15a75f932 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -1952,6 +1952,7 @@ protected: pg_t parent; }; ceph::unordered_map 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