summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2016-02-09 14:55:29 +0100
committerSage Weil <sage@redhat.com>2016-02-09 14:55:29 +0100
commitee39f436815dd64d89f01f0befeb09cff7b9d332 (patch)
treef5cfea08650df842578a82577890aa0a6301e9c8
parentMerge remote-tracking branch 'gh/jewel' (diff)
parentRevert "osd: do not keep ref of old osdmap in pg" (diff)
downloadceph-ee39f436815dd64d89f01f0befeb09cff7b9d332.tar.xz
ceph-ee39f436815dd64d89f01f0befeb09cff7b9d332.zip
Merge pull request #7570 from dzafman/wip-14213
osd: revert "osd: do not keep ref of old osdmap in pg" Reviewed-by: David Zafman <dzafman@redhat.com> Reviewed-by: Sage Weil <sage@redhat.com>
-rw-r--r--src/osd/PG.cc13
-rw-r--r--src/osd/PG.h2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/osd/PG.cc b/src/osd/PG.cc
index ac5075aaa73..c2d5b0b6d7f 100644
--- a/src/osd/PG.cc
+++ b/src/osd/PG.cc
@@ -195,7 +195,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
@@ -233,8 +233,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);
@@ -2806,7 +2805,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;
@@ -5440,15 +5439,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();
diff --git a/src/osd/PG.h b/src/osd/PG.h
index 38105989956..ff306cc9ae4 100644
--- a/src/osd/PG.h
+++ b/src/osd/PG.h
@@ -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);
@@ -2057,7 +2058,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; }