]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: move debug_verify_cached_snaps check into PGPool::update
authorSage Weil <sage@redhat.com>
Fri, 13 Oct 2017 13:40:03 +0000 (08:40 -0500)
committerSage Weil <sage@redhat.com>
Sat, 2 Dec 2017 03:26:49 +0000 (21:26 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc
src/osd/PG.h

index 596e320f3cb85ad60d5b1bad1c91d549fa87a86b..38f9a3c612fc1b09731016df58d02cca0416299e 100644 (file)
@@ -224,7 +224,7 @@ void PG::dump_live_ids()
 #endif
 
 
-void PGPool::update(OSDMapRef map)
+void PGPool::update(CephContext *cct, OSDMapRef map)
 {
   const pg_pool_t *pi = map->get_pg_pool(id);
   assert(pi);
@@ -273,6 +273,19 @@ void PGPool::update(OSDMapRef map)
     << " snapc " << snapc
     << (updated ? " (updated)":" (no change)")
     << dendl;
+  if (cct->_conf->osd_debug_verify_cached_snaps) {
+    interval_set<snapid_t> actual_removed_snaps;
+    pi->build_removed_snaps(actual_removed_snaps);
+    if (!(actual_removed_snaps == cached_removed_snaps)) {
+      lgeneric_derr(cct) << __func__
+                        << ": mismatch between the actual removed snaps "
+                        << actual_removed_snaps
+                        << " and pool.cached_removed_snaps "
+                        << " pool.cached_removed_snaps " << cached_removed_snaps
+                        << dendl;
+    }
+    assert(actual_removed_snaps == cached_removed_snaps);
+  }
 }
 
 PG::PG(OSDService *o, OSDMapRef curmap,
@@ -5912,20 +5925,7 @@ void PG::handle_advance_map(
           << " -- " << up_primary << "/" << acting_primary
           << dendl;
   update_osdmap_ref(osdmap);
-  pool.update(osdmap);
-  if (cct->_conf->osd_debug_verify_cached_snaps) {
-    interval_set<snapid_t> actual_removed_snaps;
-    const pg_pool_t *pi = osdmap->get_pg_pool(info.pgid.pool());
-    assert(pi);
-    pi->build_removed_snaps(actual_removed_snaps);
-    if (!(actual_removed_snaps == pool.cached_removed_snaps)) {
-      derr << __func__ << ": mismatch between the actual removed snaps "
-          << actual_removed_snaps << " and pool.cached_removed_snaps "
-          << " pool.cached_removed_snaps " << pool.cached_removed_snaps
-          << dendl;
-    }
-    assert(actual_removed_snaps == pool.cached_removed_snaps);
-  }
+  pool.update(cct, osdmap);
   AdvMap evt(
     osdmap, lastmap, newup, up_primary,
     newacting, acting_primary);
index ffaa361889a30117fd13ed8d21a0aef0b7a677fd..1e495da50b30fa4398c85ae044ea22983dc816fe 100644 (file)
@@ -237,7 +237,7 @@ struct PGPool {
     pi->build_removed_snaps(cached_removed_snaps);
   }
 
-  void update(OSDMapRef map);
+  void update(CephContext *cct, OSDMapRef map);
 };
 
 /** PG - Replica Placement Group