From: Alexey Sheplyakov Date: Sun, 13 Aug 2017 12:33:00 +0000 (+0400) Subject: jewel: mon: fix force_pg_create pg stuck in creating bug X-Git-Tag: v10.2.10~44^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cd848c1e9852c89a06e3baa669314cba2fdef965;p=ceph.git jewel: mon: fix force_pg_create pg stuck in creating bug Register the creating PG through the common path to get the PG mapped to an OSD. Adapted from 9a41a0b7289fa59f4b747a63e152e88af6e8abd5 Fixes: http://tracker.ceph.com/issues/19182 Signed-off-by: Alexey Sheplyakov --- diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc index 9ff5d48fb782..6381911ee96a 100644 --- a/src/mon/PGMonitor.cc +++ b/src/mon/PGMonitor.cc @@ -958,7 +958,7 @@ void PGMonitor::check_osd_map(epoch_t epoch) } void PGMonitor::register_pg(OSDMap *osdmap, - pg_pool_t& pool, pg_t pgid, epoch_t epoch, + pg_t pgid, epoch_t epoch, bool new_pool) { pg_t parent; @@ -968,7 +968,7 @@ void PGMonitor::register_pg(OSDMap *osdmap, parent = pgid; while (1) { // remove most significant bit - int msb = pool.calc_bits_of(parent.ps()); + int msb = pg_pool_t::calc_bits_of(parent.ps()); if (!msb) break; parent.set_ps(parent.ps() & ~(1<<(msb-1))); @@ -1078,7 +1078,7 @@ bool PGMonitor::register_new_pgs() continue; } created++; - register_pg(osdmap, pool, pgid, pool.get_last_change(), new_pool); + register_pg(osdmap, pgid, pool.get_last_change(), new_pool); } } @@ -1979,10 +1979,7 @@ bool PGMonitor::prepare_command(MonOpRequestRef op) goto reply; } { - pg_stat_t& s = pending_inc.pg_stat_updates[pgid]; - s.state = PG_STATE_CREATING; - s.created = epoch; - s.last_change = ceph_clock_now(g_ceph_context); + register_pg(&mon->osdmon()->osdmap, pgid, epoch, true); } ss << "pg " << pgidstr << " now creating, ok"; goto update; diff --git a/src/mon/PGMonitor.h b/src/mon/PGMonitor.h index 893099387f3a..989cfba90970 100644 --- a/src/mon/PGMonitor.h +++ b/src/mon/PGMonitor.h @@ -112,7 +112,7 @@ private: // when we last received PG stats from each osd map last_osd_report; - void register_pg(OSDMap *osdmap, pg_pool_t& pool, pg_t pgid, + void register_pg(OSDMap *osdmap, pg_t pgid, epoch_t epoch, bool new_pool); /**