From: Kefu Chai Date: Tue, 14 Mar 2017 12:03:59 +0000 (+0800) Subject: mon/OSDMonitor: switch to the new creating_pgs X-Git-Tag: v12.0.2~256^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=f61853ae8988d9dce135bcb92857e3e4e60f4ff5;p=ceph-ci.git mon/OSDMonitor: switch to the new creating_pgs * prime_pg_temp(): switch to the new creating_pgs * get_trim_to(): switch to the new creating_pgs Signed-off-by: Kefu Chai --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index fea6682a3ce..8a76f66ed02 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1177,8 +1177,7 @@ void OSDMonitor::prime_pg_temp( const OSDMap& next, pg_t pgid) { - PGMap *pg_map = &mon->pgmon()->pg_map; // FIMXE: use new creating_pgs map - if (!pg_map->creating_pgs.count(pgid)) { + if (!creating_pgs.pgs.count(pgid)) { return; } @@ -1468,8 +1467,13 @@ void OSDMonitor::share_map_with_random_osd() version_t OSDMonitor::get_trim_to() { - if (mon->pgmon()->is_readable() && - mon->pgmon()->pg_map.creating_pgs.empty()) { + { + std::lock_guard l(creating_pgs_lock); + if (!creating_pgs.pgs.empty()) { + return 0; + } + } + if (mon->pgmon()->is_readable()) { epoch_t floor = mon->pgmon()->pg_map.get_min_last_epoch_clean(); dout(10) << " min_last_epoch_clean " << floor << dendl; if (g_conf->mon_osd_force_trim_to > 0 &&