From f9667a9ef3fecb58ff6ea4a33061c14794492bb4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 20 Feb 2018 21:23:25 -0600 Subject: [PATCH] osd: fix fast pg create vs limits Signed-off-by: Sage Weil --- src/osd/OSD.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 6edf496a6cf..fae0fc28c8c 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -3982,6 +3982,8 @@ void OSD::resume_creating_pg() unsigned spare_pgs = max_pgs_per_osd - num_pgs; [[gnu::unused]] auto&& locker = guardedly_lock(pending_creates_lock); if (pending_creates_from_mon > 0) { + dout(20) << __func__ << " pending_creates_from_mon " + << pending_creates_from_mon << dendl; do_sub_pg_creates = true; if (pending_creates_from_mon >= spare_pgs) { spare_pgs = pending_creates_from_mon = 0; @@ -3992,6 +3994,7 @@ void OSD::resume_creating_pg() } auto pg = pending_creates_from_osd.cbegin(); while (spare_pgs > 0 && pg != pending_creates_from_osd.cend()) { + dout(20) << __func__ << " pg " << pg->first << dendl; if (!pgtemp) { pgtemp = new MOSDPGTemp{osdmap->get_epoch()}; } @@ -4025,7 +4028,7 @@ void OSD::resume_creating_pg() // no need to subscribe the osdmap continuously anymore // once the pgtemp and/or mon_subscribe(pg_creates) is sent if (monc->sub_want_increment("osdmap", start, CEPH_SUBSCRIBE_ONETIME)) { - dout(4) << __func__ << ": re-subscribe osdmap(onetime) since" + dout(4) << __func__ << ": re-subscribe osdmap(onetime) since " << start << dendl; do_renew_subs = true; } @@ -8314,6 +8317,13 @@ void OSD::handle_fast_pg_create(MOSDPGCreate2 *m) true) ))); } + + with_unique_lock(pending_creates_lock, [=]() { + if (pending_creates_from_mon == 0) { + last_pg_create_epoch = m->epoch; + } + }); + m->put(); } -- 2.39.5