]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Revert "osd: do not keep ref of old osdmap in pg" 7570/head
authorDavid Zafman <dzafman@redhat.com>
Mon, 8 Feb 2016 15:45:24 +0000 (07:45 -0800)
committerDavid Zafman <dzafman@redhat.com>
Mon, 8 Feb 2016 15:45:24 +0000 (07:45 -0800)
This reverts commit 8978cd6fcf40076dbd944a2938b335d26c62b8d5.

Fixes: #14213
src/osd/PG.cc
src/osd/PG.h

index afcd3e37e382e72161b84fcbc61755efde0e9540..6c249c39291303e619ec5decf5b3f588801332b3 100644 (file)
@@ -185,7 +185,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
     _pool.id,
     p.shard),
   map_lock("PG::map_lock"),
-  osdmap_ref(curmap), pool(_pool),
+  osdmap_ref(curmap), last_persisted_osdmap_ref(curmap), pool(_pool),
   _lock("PG::_lock"),
   ref(0),
   #ifdef PG_DEBUG_REFS
@@ -223,8 +223,7 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   acting_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
   upacting_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
   do_sort_bitwise(false),
-  last_epoch(0),
-  last_persisted_epoch(curmap->get_epoch())
+  last_epoch(0)
 {
 #ifdef PG_DEBUG_REFS
   osd->add_pgid(p, this);
@@ -2787,7 +2786,7 @@ void PG::prepare_write_info(map<string,bufferlist> *km)
   assert(ret == 0);
   if (need_update_epoch)
     last_epoch = get_osdmap()->get_epoch();
-  last_persisted_epoch = last_epoch;
+  last_persisted_osdmap_ref = osdmap_ref;
 
   dirty_info = false;
   dirty_big_info = false;
@@ -5424,15 +5423,15 @@ void PG::handle_activate_map(RecoveryCtx *rctx)
   dout(10) << "handle_activate_map " << dendl;
   ActMap evt;
   recovery_state.handle_event(evt, rctx);
-  if (osdmap_ref->get_epoch() - last_persisted_epoch >
+  if (osdmap_ref->get_epoch() - last_persisted_osdmap_ref->get_epoch() >
     cct->_conf->osd_pg_epoch_persisted_max_stale) {
     dout(20) << __func__ << ": Dirtying info: last_persisted is "
-            << last_persisted_epoch
+            << last_persisted_osdmap_ref->get_epoch()
             << " while current is " << osdmap_ref->get_epoch() << dendl;
     dirty_info = true;
   } else {
     dout(20) << __func__ << ": Not dirtying info: last_persisted is "
-            << last_persisted_epoch
+            << last_persisted_osdmap_ref->get_epoch()
             << " while current is " << osdmap_ref->get_epoch() << dendl;
   }
   if (osdmap_ref->check_new_blacklist_entries()) check_blacklisted_watchers();
index c5f1c12ff7af45806fd13c6014b2a356bac3dfd6..30c002ee75ec78eed7ba9c587f46114f8e97166c 100644 (file)
@@ -206,6 +206,7 @@ protected:
   Mutex map_lock;
   list<OpRequestRef> waiting_for_map;
   OSDMapRef osdmap_ref;
+  OSDMapRef last_persisted_osdmap_ref;
   PGPool pool;
 
   void queue_op(OpRequestRef& op);
@@ -2055,7 +2056,6 @@ public:
 
   bool do_sort_bitwise;
   epoch_t last_epoch;
-  epoch_t last_persisted_epoch;
 
  public:
   const spg_t&      get_pgid() const { return pg_id; }