]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: switch to the new creating_pgs
authorKefu Chai <kchai@redhat.com>
Tue, 14 Mar 2017 12:03:59 +0000 (20:03 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 30 Mar 2017 12:21:18 +0000 (20:21 +0800)
* prime_pg_temp(): switch to the new creating_pgs
* get_trim_to(): switch to the new creating_pgs

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/OSDMonitor.cc

index fea6682a3ce4e24a85673ab6d4a88f95682f789c..8a76f66ed02eca02c22e5d3f57b3e0095c6dc0b8 100644 (file)
@@ -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<Spinlock> 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 &&