From f61853ae8988d9dce135bcb92857e3e4e60f4ff5 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 14 Mar 2017 20:03:59 +0800 Subject: [PATCH] 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 --- src/mon/OSDMonitor.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 && -- 2.39.5