]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: massively switch to get_osdmap_epoch().
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 30 Oct 2018 20:52:41 +0000 (21:52 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 31 Oct 2018 15:57:27 +0000 (16:57 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/PGBackend.cc
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h
src/osd/ReplicatedBackend.cc

index 7a777d3fbd7c36bd9c405124bb553dff9266146c..749c45eb29d19c7dde69269a9e362cdf086becb8 100644 (file)
@@ -122,7 +122,7 @@ void PGStateHistory::exit(const char* state) {
     if (pi == nullptr) {
       buffer.push_back(std::unique_ptr<PGStateInstance>(tmppi.release()));
       pi = buffer.back().get();
-      pi->setepoch(thispg->get_osdmap()->get_epoch());
+      pi->setepoch(thispg->get_osdmap_epoch());
     }
 
     pi->exit_state(ceph_clock_now());
@@ -582,8 +582,8 @@ bool PG::search_for_missing(
       make_pair(
        pg_notify_t(
          from.shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          tinfo),
        past_intervals));
   }
@@ -834,7 +834,7 @@ void PG::discover_all_missing(map<int, map<spg_t,pg_query_t> > &query_map)
       pg_query_t(
        pg_query_t::FULLLOG,
        peer.shard, pg_whoami.shard,
-       info.history, get_osdmap()->get_epoch());
+       info.history, get_osdmap_epoch());
   }
 }
 
@@ -1873,7 +1873,7 @@ void PG::activate(ObjectStore::Transaction& t,
   t.register_on_complete(
     new C_PG_ActivateCommitted(
       this,
-      get_osdmap()->get_epoch(),
+      get_osdmap_epoch(),
       activation_epoch));
   
   if (is_primary()) {
@@ -1968,15 +1968,15 @@ void PG::activate(ObjectStore::Transaction& t,
            make_pair(
              pg_notify_t(
                peer.shard, pg_whoami.shard,
-               get_osdmap()->get_epoch(),
-               get_osdmap()->get_epoch(),
+               get_osdmap_epoch(),
+               get_osdmap_epoch(),
                info),
              past_intervals));
        } else {
          dout(10) << "activate peer osd." << peer << " is up to date, but sending pg_log anyway" << dendl;
          m = new MOSDPGLog(
            i->shard, pg_whoami.shard,
-           get_osdmap()->get_epoch(), info,
+           get_osdmap_epoch(), info,
            last_peering_reset);
        }
       } else if (
@@ -2011,7 +2011,7 @@ void PG::activate(ObjectStore::Transaction& t,
 
        m = new MOSDPGLog(
          i->shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(), pi,
+         get_osdmap_epoch(), pi,
          last_peering_reset /* epoch to create pg at */);
 
        // send some recent log, so that op dup detection works well.
@@ -2025,7 +2025,7 @@ void PG::activate(ObjectStore::Transaction& t,
        ceph_assert(pg_log.get_tail() <= pi.last_update);
        m = new MOSDPGLog(
          i->shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(), info,
+         get_osdmap_epoch(), info,
          last_peering_reset /* epoch to create pg at */);
        // send new stuff to append to replicas log
        m->log.copy_after(pg_log.get_log(), pi.last_update);
@@ -2056,7 +2056,7 @@ void PG::activate(ObjectStore::Transaction& t,
       if (m) {
        dout(10) << "activate peer osd." << peer << " sending " << m->log << dendl;
        //m->log.print(cout);
-       osd->send_message_osd_cluster(peer.osd, m, get_osdmap()->get_epoch());
+       osd->send_message_osd_cluster(peer.osd, m, get_osdmap_epoch());
       }
 
       // peer now has 
@@ -2219,8 +2219,8 @@ void PG::_activate_committed(epoch_t epoch, epoch_t activation_epoch)
     MOSDPGInfo *m = new MOSDPGInfo(epoch);
     pg_notify_t i = pg_notify_t(
       get_primary().shard, pg_whoami.shard,
-      get_osdmap()->get_epoch(),
-      get_osdmap()->get_epoch(),
+      get_osdmap_epoch(),
+      get_osdmap_epoch(),
       info);
 
     i.info.history.last_epoch_started = activation_epoch;
@@ -2232,7 +2232,7 @@ void PG::_activate_committed(epoch_t epoch, epoch_t activation_epoch)
     }
 
     m->pg_list.push_back(make_pair(i, PastIntervals()));
-    osd->send_message_osd_cluster(get_primary().osd, m, get_osdmap()->get_epoch());
+    osd->send_message_osd_cluster(get_primary().osd, m, get_osdmap_epoch());
 
     // waiters
     if (flushes_in_progress == 0) {
@@ -2275,8 +2275,8 @@ void PG::all_activated_and_committed()
   queue_peering_event(
     PGPeeringEventRef(
       std::make_shared<PGPeeringEvent>(
-        get_osdmap()->get_epoch(),
-        get_osdmap()->get_epoch(),
+        get_osdmap_epoch(),
+        get_osdmap_epoch(),
         AllReplicasActivated())));
 }
 
@@ -2343,7 +2343,7 @@ void PG::try_mark_clean()
   if (actingset.size() == get_osdmap()->get_pg_size(info.pgid.pgid)) {
     state_clear(PG_STATE_FORCED_BACKFILL | PG_STATE_FORCED_RECOVERY);
     state_set(PG_STATE_CLEAN);
-    info.history.last_epoch_clean = get_osdmap()->get_epoch();
+    info.history.last_epoch_clean = get_osdmap_epoch();
     info.history.last_interval_clean = info.history.same_interval_since;
     past_intervals.clear();
     dirty_big_info = true;
@@ -2598,7 +2598,7 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits)
 
   // Info
   child->info.history = info.history;
-  child->info.history.epoch_created = get_osdmap()->get_epoch();
+  child->info.history.epoch_created = get_osdmap_epoch();
   child->info.purged_snaps = info.purged_snaps;
 
   if (info.last_backfill.is_max()) {
@@ -2639,13 +2639,13 @@ void PG::split_into(pg_t child_pgid, PG *child, unsigned split_bits)
 
   // this comparison includes primary rank via pg_shard_t
   if (get_primary() != child->get_primary())
-    child->info.history.same_primary_since = get_osdmap()->get_epoch();
+    child->info.history.same_primary_since = get_osdmap_epoch();
 
   child->info.stats.up = up;
   child->info.stats.up_primary = up_primary;
   child->info.stats.acting = acting;
   child->info.stats.acting_primary = primary;
-  child->info.stats.mapping_epoch = get_osdmap()->get_epoch();
+  child->info.stats.mapping_epoch = get_osdmap_epoch();
 
   // History
   child->past_intervals = past_intervals;
@@ -2807,7 +2807,7 @@ void PG::add_backoff(SessionRef s, const hobject_t& begin, const hobject_t& end)
   con->send_message(
     new MOSDBackoff(
       info.pgid,
-      get_osdmap()->get_epoch(),
+      get_osdmap_epoch(),
       CEPH_OSD_BACKOFF_OP_BLOCK,
       b->id,
       begin,
@@ -2859,7 +2859,7 @@ void PG::release_backoffs(const hobject_t& begin, const hobject_t& end)
        con->send_message(
          new MOSDBackoff(
            info.pgid,
-           get_osdmap()->get_epoch(),
+           get_osdmap_epoch(),
            CEPH_OSD_BACKOFF_OP_UNBLOCK,
            b->id,
            b->begin,
@@ -2971,9 +2971,9 @@ void PG::purge_strays()
       vector<spg_t> to_remove;
       to_remove.push_back(spg_t(info.pgid.pgid, p->shard));
       MOSDPGRemove *m = new MOSDPGRemove(
-       get_osdmap()->get_epoch(),
+       get_osdmap_epoch(),
        to_remove);
-      osd->send_message_osd_cluster(p->osd, m, get_osdmap()->get_epoch());
+      osd->send_message_osd_cluster(p->osd, m, get_osdmap_epoch());
     } else {
       dout(10) << "not sending PGRemove to down osd." << *p << dendl;
     }
@@ -3417,7 +3417,7 @@ void PG::publish_stats_to_osd()
             << ": no change since " << info.stats.last_fresh << dendl;
   } else {
     // update our stat summary and timestamps
-    info.stats.reported_epoch = get_osdmap()->get_epoch();
+    info.stats.reported_epoch = get_osdmap_epoch();
     ++info.stats.reported_seq;
 
     info.stats.last_fresh = now;
@@ -3662,8 +3662,8 @@ void PG::prepare_write_info(map<string,bufferlist> *km)
   info.stats.stats.add(unstable_stats);
   unstable_stats.clear();
 
-  bool need_update_epoch = last_epoch < get_osdmap()->get_epoch();
-  int ret = _prepare_write_info(cct, km, get_osdmap()->get_epoch(),
+  bool need_update_epoch = last_epoch < get_osdmap_epoch();
+  int ret = _prepare_write_info(cct, km, get_osdmap_epoch(),
                                info,
                                last_written_info,
                                past_intervals,
@@ -3672,7 +3672,7 @@ void PG::prepare_write_info(map<string,bufferlist> *km)
                                osd->logger);
   ceph_assert(ret == 0);
   if (need_update_epoch)
-    last_epoch = get_osdmap()->get_epoch();
+    last_epoch = get_osdmap_epoch();
   last_persisted_osdmap = last_epoch;
 
   dirty_info = false;
@@ -4107,7 +4107,7 @@ void PG::requeue_op(OpRequestRef op)
        op->get_req()->get_priority(),
        op->get_req()->get_recv_stamp(),
        op->get_req()->get_source().num(),
-       get_osdmap()->get_epoch()));
+       get_osdmap_epoch()));
   }
 }
 
@@ -4123,7 +4123,7 @@ void PG::requeue_ops(list<OpRequestRef> &ls)
 
 void PG::requeue_map_waiters()
 {
-  epoch_t epoch = get_osdmap()->get_epoch();
+  epoch_t epoch = get_osdmap_epoch();
   auto p = waiting_for_map.begin();
   while (p != waiting_for_map.end()) {
     if (epoch < p->second.front()->min_epoch) {
@@ -4376,7 +4376,7 @@ void PG::_request_scrub_map(
           << " deep " << (int)deep << dendl;
   MOSDRepScrub *repscrubop = new MOSDRepScrub(
     spg_t(info.pgid.pgid, replica.shard), version,
-    get_osdmap()->get_epoch(),
+    get_osdmap_epoch(),
     get_last_peering_reset(),
     start, end, deep,
     allow_preemption,
@@ -4385,7 +4385,7 @@ void PG::_request_scrub_map(
   // default priority, we want the rep scrub processed prior to any recovery
   // or client io messages (we are holding a lock!)
   osd->send_message_osd_cluster(
-    replica.osd, repscrubop, get_osdmap()->get_epoch());
+    replica.osd, repscrubop, get_osdmap_epoch());
 }
 
 void PG::handle_scrub_reserve_request(OpRequestRef op)
@@ -4463,8 +4463,8 @@ void PG::reject_reservation()
     new MBackfillReserve(
       MBackfillReserve::REJECT,
       spg_t(info.pgid.pgid, primary.shard),
-      get_osdmap()->get_epoch()),
-    get_osdmap()->get_epoch());
+      get_osdmap_epoch()),
+    get_osdmap_epoch());
 }
 
 void PG::schedule_backfill_retry(float delay)
@@ -4473,7 +4473,7 @@ void PG::schedule_backfill_retry(float delay)
   osd->recovery_request_timer.add_event_after(
     delay,
     new QueuePeeringEvt<RequestBackfill>(
-      this, get_osdmap()->get_epoch(),
+      this, get_osdmap_epoch(),
       RequestBackfill()));
 }
 
@@ -4483,7 +4483,7 @@ void PG::schedule_recovery_retry(float delay)
   osd->recovery_request_timer.add_event_after(
     delay,
     new QueuePeeringEvt<DoRecovery>(
-      this, get_osdmap()->get_epoch(),
+      this, get_osdmap_epoch(),
       DoRecovery()));
 }
 
@@ -4509,9 +4509,9 @@ void PG::scrub_reserve_replicas()
     osd->send_message_osd_cluster(
       i->osd,
       new MOSDScrubReserve(spg_t(info.pgid.pgid, i->shard),
-                          get_osdmap()->get_epoch(),
+                          get_osdmap_epoch(),
                           MOSDScrubReserve::REQUEST, pg_whoami),
-      get_osdmap()->get_epoch());
+      get_osdmap_epoch());
   }
 }
 
@@ -4526,9 +4526,9 @@ void PG::scrub_unreserve_replicas()
     osd->send_message_osd_cluster(
       i->osd,
       new MOSDScrubReserve(spg_t(info.pgid.pgid, i->shard),
-                          get_osdmap()->get_epoch(),
+                          get_osdmap_epoch(),
                           MOSDScrubReserve::RELEASE, pg_whoami),
-      get_osdmap()->get_epoch());
+      get_osdmap_epoch());
   }
 }
 
@@ -5701,8 +5701,8 @@ void PG::scrub_finish()
     queue_peering_event(
       PGPeeringEventRef(
        std::make_shared<PGPeeringEvent>(
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          DoRecovery())));
   }
 
@@ -5731,16 +5731,16 @@ void PG::share_pg_info()
       peer->second.last_interval_started = info.last_interval_started;
       peer->second.history.merge(info.history);
     }
-    MOSDPGInfo *m = new MOSDPGInfo(get_osdmap()->get_epoch());
+    MOSDPGInfo *m = new MOSDPGInfo(get_osdmap_epoch());
     m->pg_list.push_back(
       make_pair(
        pg_notify_t(
          pg_shard.shard, pg_whoami.shard,
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          info),
        past_intervals));
-    osd->send_message_osd_cluster(pg_shard.osd, m, get_osdmap()->get_epoch());
+    osd->send_message_osd_cluster(pg_shard.osd, m, get_osdmap_epoch());
   }
 }
 
@@ -5868,12 +5868,12 @@ void PG::fulfill_log(
   ceph_assert(from == primary);
   ceph_assert(query.type != pg_query_t::INFO);
   ConnectionRef con = osd->get_con_osd_cluster(
-    from.osd, get_osdmap()->get_epoch());
+    from.osd, get_osdmap_epoch());
   if (!con) return;
 
   MOSDPGLog *mlog = new MOSDPGLog(
     from.shard, pg_whoami.shard,
-    get_osdmap()->get_epoch(),
+    get_osdmap_epoch(),
     info, query_epoch);
   mlog->missing = pg_log.get_missing();
 
@@ -5911,7 +5911,7 @@ void PG::fulfill_query(const MQuery& query, RecoveryCtx *rctx)
       pg_notify_t(
        notify_info.first.shard, pg_whoami.shard,
        query.query_epoch,
-       get_osdmap()->get_epoch(),
+       get_osdmap_epoch(),
        notify_info.second),
       past_intervals);
   } else {
@@ -5990,9 +5990,9 @@ bool PG::old_peering_msg(epoch_t reply_epoch, epoch_t query_epoch)
 
 void PG::set_last_peering_reset()
 {
-  dout(20) << "set_last_peering_reset " << get_osdmap()->get_epoch() << dendl;
-  if (last_peering_reset != get_osdmap()->get_epoch()) {
-    last_peering_reset = get_osdmap()->get_epoch();
+  dout(20) << "set_last_peering_reset " << get_osdmap_epoch() << dendl;
+  if (last_peering_reset != get_osdmap_epoch()) {
+    last_peering_reset = get_osdmap_epoch();
     reset_interval_flush();
   }
 }
@@ -6014,7 +6014,7 @@ void PG::start_flush(ObjectStore::Transaction *t)
 {
   // flush in progress ops
   FlushStateRef flush_trigger (std::make_shared<FlushState>(
-                               this, get_osdmap()->get_epoch()));
+                               this, get_osdmap_epoch()));
   flushes_in_progress++;
   t->register_on_applied(new ContainerContext<FlushStateRef>(flush_trigger));
   t->register_on_commit(new ContainerContext<FlushStateRef>(flush_trigger));
@@ -6026,7 +6026,7 @@ void PG::reset_interval_flush()
   recovery_state.clear_blocked_outgoing();
   
   Context *c = new QueuePeeringEvt<IntervalFlush>(
-    this, get_osdmap()->get_epoch(), IntervalFlush());
+    this, get_osdmap_epoch(), IntervalFlush());
   if (!ch->flush_commit(c)) {
     dout(10) << "Beginning to block outgoing recovery messages" << dendl;
     recovery_state.begin_block_outgoing();
@@ -6750,10 +6750,9 @@ void PG::_delete_some(ObjectStore::Transaction *t)
     t->remove(coll, oid);
     ++num;
   }
-  epoch_t e = get_osdmap()->get_epoch();
   if (num) {
     dout(20) << __func__ << " deleting " << num << " objects" << dendl;
-    Context *fin = new C_DeleteMore(this, e);
+    Context *fin = new C_DeleteMore(this, get_osdmap_epoch());
     t->register_on_commit(fin);
   } else {
     dout(20) << __func__ << " finished" << dendl;
@@ -6964,8 +6963,8 @@ boost::statechart::result PG::RecoveryState::Reset::react(const ActMap&)
       pg->get_primary(),
       pg_notify_t(
        pg->get_primary().shard, pg->pg_whoami.shard,
-       pg->get_osdmap()->get_epoch(),
-       pg->get_osdmap()->get_epoch(),
+       pg->get_osdmap_epoch(),
+       pg->get_osdmap_epoch(),
        pg->info),
       pg->past_intervals);
   }
@@ -7243,13 +7242,13 @@ void PG::RecoveryState::Backfilling::backfill_release_reservations()
        ++it) {
     ceph_assert(*it != pg->pg_whoami);
     ConnectionRef con = pg->osd->get_con_osd_cluster(
-      it->osd, pg->get_osdmap()->get_epoch());
+      it->osd, pg->get_osdmap_epoch());
     if (con) {
       pg->osd->send_message_osd_cluster(
         new MBackfillReserve(
          MBackfillReserve::RELEASE,
          spg_t(pg->info.pgid.pgid, it->shard),
-         pg->get_osdmap()->get_epoch()),
+         pg->get_osdmap_epoch()),
        con.get());
     }
   }
@@ -7350,13 +7349,13 @@ PG::RecoveryState::WaitRemoteBackfillReserved::react(const RemoteBackfillReserve
     //The primary never backfills itself
     ceph_assert(*backfill_osd_it != pg->pg_whoami);
     ConnectionRef con = pg->osd->get_con_osd_cluster(
-      backfill_osd_it->osd, pg->get_osdmap()->get_epoch());
+      backfill_osd_it->osd, pg->get_osdmap_epoch());
     if (con) {
       pg->osd->send_message_osd_cluster(
         new MBackfillReserve(
        MBackfillReserve::REQUEST,
        spg_t(pg->info.pgid.pgid, backfill_osd_it->shard),
-       pg->get_osdmap()->get_epoch(),
+       pg->get_osdmap_epoch(),
        pg->get_backfill_priority()),
       con.get());
     }
@@ -7389,13 +7388,13 @@ void PG::RecoveryState::WaitRemoteBackfillReserved::retry()
     //The primary never backfills itself
     ceph_assert(*it != pg->pg_whoami);
     ConnectionRef con = pg->osd->get_con_osd_cluster(
-      it->osd, pg->get_osdmap()->get_epoch());
+      it->osd, pg->get_osdmap_epoch());
     if (con) {
       pg->osd->send_message_osd_cluster(
         new MBackfillReserve(
        MBackfillReserve::RELEASE,
        spg_t(pg->info.pgid.pgid, it->shard),
-       pg->get_osdmap()->get_epoch()),
+       pg->get_osdmap_epoch()),
       con.get());
     }
   }
@@ -7432,11 +7431,11 @@ PG::RecoveryState::WaitLocalBackfillReserved::WaitLocalBackfillReserved(my_conte
   pg->osd->local_reserver.request_reservation(
     pg->info.pgid,
     new QueuePeeringEvt<LocalBackfillReserved>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       LocalBackfillReserved()),
     pg->get_backfill_priority(),
     new QueuePeeringEvt<DeferBackfill>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       DeferBackfill(0.0)));
   pg->publish_stats_to_osd();
 }
@@ -7541,8 +7540,8 @@ PG::RecoveryState::RepWaitRecoveryReserved::react(const RemoteRecoveryReserved &
     new MRecoveryReserve(
       MRecoveryReserve::GRANT,
       spg_t(pg->info.pgid.pgid, pg->primary.shard),
-      pg->get_osdmap()->get_epoch()),
-    pg->get_osdmap()->get_epoch());
+      pg->get_osdmap_epoch()),
+    pg->get_osdmap_epoch());
   return transit<RepRecovering>();
 }
 
@@ -7590,13 +7589,13 @@ PG::RecoveryState::RepNotRecovering::react(const RequestBackfillPrio &evt)
     if (HAVE_FEATURE(pg->upacting_features, RECOVERY_RESERVATION_2)) {
       // older peers will interpret preemption as TOOFULL
       preempt = new QueuePeeringEvt<RemoteBackfillPreempted>(
-       pg, pg->get_osdmap()->get_epoch(),
+       pg, pg->get_osdmap_epoch(),
        RemoteBackfillPreempted());
     }
     pg->osd->remote_reserver.request_reservation(
       pg->info.pgid,
       new QueuePeeringEvt<RemoteBackfillReserved>(
-        pg, pg->get_osdmap()->get_epoch(),
+        pg, pg->get_osdmap_epoch(),
         RemoteBackfillReserved()),
       evt.priority,
       preempt);
@@ -7617,14 +7616,14 @@ PG::RecoveryState::RepNotRecovering::react(const RequestRecoveryPrio &evt)
   if (HAVE_FEATURE(pg->upacting_features, RECOVERY_RESERVATION_2)) {
     // older peers can't handle this
     preempt = new QueuePeeringEvt<RemoteRecoveryPreempted>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       RemoteRecoveryPreempted());
   }
 
   pg->osd->remote_reserver.request_reservation(
     pg->info.pgid,
     new QueuePeeringEvt<RemoteRecoveryReserved>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       RemoteRecoveryReserved()),
     prio,
     preempt);
@@ -7662,8 +7661,8 @@ PG::RecoveryState::RepWaitBackfillReserved::react(const RemoteBackfillReserved &
       new MBackfillReserve(
        MBackfillReserve::GRANT,
        spg_t(pg->info.pgid.pgid, pg->primary.shard),
-       pg->get_osdmap()->get_epoch()),
-      pg->get_osdmap()->get_epoch());
+       pg->get_osdmap_epoch()),
+      pg->get_osdmap_epoch());
     return transit<RepRecovering>();
   }
 }
@@ -7721,8 +7720,8 @@ PG::RecoveryState::RepRecovering::react(const RemoteRecoveryPreempted &)
     new MRecoveryReserve(
       MRecoveryReserve::REVOKE,
       spg_t(pg->info.pgid.pgid, pg->primary.shard),
-      pg->get_osdmap()->get_epoch()),
-    pg->get_osdmap()->get_epoch());
+      pg->get_osdmap_epoch()),
+    pg->get_osdmap_epoch());
   return discard_event();
 }
 
@@ -7735,8 +7734,8 @@ PG::RecoveryState::RepRecovering::react(const BackfillTooFull &)
     new MBackfillReserve(
       MBackfillReserve::TOOFULL,
       spg_t(pg->info.pgid.pgid, pg->primary.shard),
-      pg->get_osdmap()->get_epoch()),
-    pg->get_osdmap()->get_epoch());
+      pg->get_osdmap_epoch()),
+    pg->get_osdmap_epoch());
   return discard_event();
 }
 
@@ -7749,8 +7748,8 @@ PG::RecoveryState::RepRecovering::react(const RemoteBackfillPreempted &)
     new MBackfillReserve(
       MBackfillReserve::REVOKE,
       spg_t(pg->info.pgid.pgid, pg->primary.shard),
-      pg->get_osdmap()->get_epoch()),
-    pg->get_osdmap()->get_epoch());
+      pg->get_osdmap_epoch()),
+    pg->get_osdmap_epoch());
   return discard_event();
 }
 
@@ -7798,11 +7797,11 @@ PG::RecoveryState::WaitLocalRecoveryReserved::WaitLocalRecoveryReserved(my_conte
   pg->osd->local_reserver.request_reservation(
     pg->info.pgid,
     new QueuePeeringEvt<LocalRecoveryReserved>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       LocalRecoveryReserved()),
     pg->get_recovery_priority(),
     new QueuePeeringEvt<DeferRecovery>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       DeferRecovery(0.0)));
   pg->publish_stats_to_osd();
 }
@@ -7840,13 +7839,13 @@ PG::RecoveryState::WaitRemoteRecoveryReserved::react(const RemoteRecoveryReserve
   if (remote_recovery_reservation_it != context< Active >().remote_shards_to_reserve_recovery.end()) {
     ceph_assert(*remote_recovery_reservation_it != pg->pg_whoami);
     ConnectionRef con = pg->osd->get_con_osd_cluster(
-      remote_recovery_reservation_it->osd, pg->get_osdmap()->get_epoch());
+      remote_recovery_reservation_it->osd, pg->get_osdmap_epoch());
     if (con) {
       pg->osd->send_message_osd_cluster(
         new MRecoveryReserve(
          MRecoveryReserve::REQUEST,
          spg_t(pg->info.pgid.pgid, remote_recovery_reservation_it->shard),
-         pg->get_osdmap()->get_epoch(),
+         pg->get_osdmap_epoch(),
          pg->get_recovery_priority()),
        con.get());
     }
@@ -7893,13 +7892,13 @@ void PG::RecoveryState::Recovering::release_reservations(bool cancel)
     if (*i == pg->pg_whoami) // skip myself
       continue;
     ConnectionRef con = pg->osd->get_con_osd_cluster(
-      i->osd, pg->get_osdmap()->get_epoch());
+      i->osd, pg->get_osdmap_epoch());
     if (con) {
       pg->osd->send_message_osd_cluster(
         new MRecoveryReserve(
          MRecoveryReserve::RELEASE,
          spg_t(pg->info.pgid.pgid, i->shard),
-         pg->get_osdmap()->get_epoch()),
+         pg->get_osdmap_epoch()),
        con.get());
     }
   }
@@ -8074,7 +8073,7 @@ PG::RecoveryState::Active::Active(my_context ctx)
   ldout(pg->cct, 10) << "In Active, about to call activate" << dendl;
   pg->start_flush(context< RecoveryMachine >().get_cur_transaction());
   pg->activate(*context< RecoveryMachine >().get_cur_transaction(),
-              pg->get_osdmap()->get_epoch(),
+              pg->get_osdmap_epoch(),
               *context< RecoveryMachine >().get_query_map(),
               context< RecoveryMachine >().get_info_map(),
               context< RecoveryMachine >().get_recovery_ctx());
@@ -8555,8 +8554,8 @@ boost::statechart::result PG::RecoveryState::ReplicaActive::react(const ActMap&)
       pg->get_primary(),
       pg_notify_t(
        pg->get_primary().shard, pg->pg_whoami.shard,
-       pg->get_osdmap()->get_epoch(),
-       pg->get_osdmap()->get_epoch(),
+       pg->get_osdmap_epoch(),
+       pg->get_osdmap_epoch(),
        pg->info),
       pg->past_intervals);
   }
@@ -8674,8 +8673,8 @@ boost::statechart::result PG::RecoveryState::Stray::react(const ActMap&)
       pg->get_primary(),
       pg_notify_t(
        pg->get_primary().shard, pg->pg_whoami.shard,
-       pg->get_osdmap()->get_epoch(),
-       pg->get_osdmap()->get_epoch(),
+       pg->get_osdmap_epoch(),
+       pg->get_osdmap_epoch(),
        pg->info),
       pg->past_intervals);
   }
@@ -8725,11 +8724,11 @@ PG::RecoveryState::WaitDeleteReserved::WaitDeleteReserved(my_context ctx)
   pg->osd->local_reserver.request_reservation(
     pg->info.pgid,
     new QueuePeeringEvt<DeleteReserved>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       DeleteReserved()),
     context<ToDelete>().priority,
     new QueuePeeringEvt<DeleteInterrupted>(
-      pg, pg->get_osdmap()->get_epoch(),
+      pg, pg->get_osdmap_epoch(),
       DeleteInterrupted()));
 }
 
@@ -8760,7 +8759,7 @@ PG::RecoveryState::Deleting::Deleting(my_context ctx)
   pg->deleting = true;
   ObjectStore::Transaction* t = context<RecoveryMachine>().get_cur_transaction();
   pg->on_removal(t);
-  t->register_on_commit(new C_DeleteMore(pg, pg->get_osdmap()->get_epoch()));
+  t->register_on_commit(new C_DeleteMore(pg, pg->get_osdmap_epoch()));
 }
 
 boost::statechart::result PG::RecoveryState::Deleting::react(
@@ -8831,7 +8830,7 @@ void PG::RecoveryState::GetInfo::get_infos()
        peer, pg_query_t(pg_query_t::INFO,
                         it->shard, pg->pg_whoami.shard,
                         pg->info.history,
-                        pg->get_osdmap()->get_epoch()));
+                        pg->get_osdmap_epoch()));
       peer_info_requested.insert(peer);
       pg->blocked_by.insert(peer.osd);
     }
@@ -8981,7 +8980,7 @@ PG::RecoveryState::GetLog::GetLog(my_context ctx)
       pg_query_t::LOG,
       auth_log_shard.shard, pg->pg_whoami.shard,
       request_log_from, pg->info.history,
-      pg->get_osdmap()->get_epoch()));
+      pg->get_osdmap_epoch()));
 
   ceph_assert(pg->blocked_by.empty());
   pg->blocked_by.insert(auth_log_shard.osd);
@@ -9304,7 +9303,7 @@ PG::RecoveryState::GetMissing::GetMissing(my_context ctx)
          pg_query_t::LOG,
          i->shard, pg->pg_whoami.shard,
          since, pg->info.history,
-         pg->get_osdmap()->get_epoch()));
+         pg->get_osdmap_epoch()));
     } else {
       ldout(pg->cct, 10) << " requesting fulllog+missing from osd." << *i
                         << " (want since " << since << " < log.tail "
@@ -9313,7 +9312,7 @@ PG::RecoveryState::GetMissing::GetMissing(my_context ctx)
        *i, pg_query_t(
          pg_query_t::FULLLOG,
          i->shard, pg->pg_whoami.shard,
-         pg->info.history, pg->get_osdmap()->get_epoch()));
+         pg->info.history, pg->get_osdmap_epoch()));
     }
     peer_missing_requested.insert(*i);
     pg->blocked_by.insert(i->osd);
@@ -9328,7 +9327,7 @@ PG::RecoveryState::GetMissing::GetMissing(my_context ctx)
     }
 
     // all good!
-    post_event(Activate(pg->get_osdmap()->get_epoch()));
+    post_event(Activate(pg->get_osdmap_epoch()));
   } else {
     pg->publish_stats_to_osd();
   }
@@ -9349,7 +9348,7 @@ boost::statechart::result PG::RecoveryState::GetMissing::react(const MLogRec& lo
     } else {
       ldout(pg->cct, 10) << "Got last missing, don't need missing "
                         << "posting Activate" << dendl;
-      post_event(Activate(pg->get_osdmap()->get_epoch()));
+      post_event(Activate(pg->get_osdmap_epoch()));
     }
   }
   return discard_event();
@@ -9402,7 +9401,7 @@ boost::statechart::result PG::RecoveryState::WaitUpThru::react(const ActMap& am)
 {
   PG *pg = context< RecoveryMachine >().pg;
   if (!pg->need_up_thru) {
-    post_event(Activate(pg->get_osdmap()->get_epoch()));
+    post_event(Activate(pg->get_osdmap_epoch()));
   }
   return forward_event();
 }
index 27900c6a032b8cc3df93ff0f22a18500a15e7712..ddfa93ce2e445c205d95ce2de0c982c6c6ad2d2c 100644 (file)
@@ -2880,7 +2880,7 @@ protected:
   eversion_t projected_last_update;
   eversion_t get_next_version() const {
     eversion_t at_version(
-      get_osdmap()->get_epoch(),
+      get_osdmap_epoch(),
       projected_last_update.version+1);
     ceph_assert(at_version > info.last_update);
     ceph_assert(at_version > pg_log.get_head());
index 205b59940b94c2c9a2ba6b2595219575c669b972..5d59f58e15b512c94f27431cc5b0bce79499707e 100644 (file)
@@ -64,7 +64,7 @@ void PGBackend::send_recovery_deletes(int prio,
     const auto& objects = p.second;
     ConnectionRef con = get_parent()->get_con_osd_cluster(
       shard.osd,
-      get_osdmap()->get_epoch());
+      get_osdmap_epoch());
     if (!con)
       continue;
     auto it = objects.begin();
@@ -75,7 +75,7 @@ void PGBackend::send_recovery_deletes(int prio,
       MOSDPGRecoveryDelete *msg =
        new MOSDPGRecoveryDelete(get_parent()->whoami_shard(),
                                 target_pg,
-                                get_osdmap()->get_epoch(),
+                                get_osdmap_epoch(),
                                 min_epoch);
       msg->set_priority(prio);
 
index e6a8ba1f4750e708a16b50c64969039104d5e0eb..a1d0a21992979279ed08178f2d5d8bd9b4d1c8c8 100644 (file)
@@ -444,7 +444,7 @@ void PrimaryLogPG::on_local_recover(
   t->register_on_commit(
     new C_OSD_CommittedPushedObject(
       this,
-      get_osdmap()->get_epoch(),
+      get_osdmap_epoch(),
       info.last_complete));
 
   // update pg
@@ -999,7 +999,7 @@ int PrimaryLogPG::do_command(
     f->dump_string("state", pg_state_string(get_state()));
     f->dump_stream("snap_trimq") << snap_trimq;
     f->dump_unsigned("snap_trimq_len", snap_trimq.size());
-    f->dump_unsigned("epoch", get_osdmap()->get_epoch());
+    f->dump_unsigned("epoch", get_osdmap_epoch());
     f->open_array_section("up");
     for (vector<int>::iterator p = up.begin(); p != up.end(); ++p)
       f->dump_unsigned("osd", *p);
@@ -1564,7 +1564,7 @@ void PrimaryLogPG::do_pg_op(OpRequestRef op)
   }
 
   // reply
-  MOSDOpReply *reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(),
+  MOSDOpReply *reply = new MOSDOpReply(m, 0, get_osdmap_epoch(),
                                       CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK,
                                       false);
   reply->claim_op_out_data(ops);
@@ -2737,7 +2737,7 @@ void PrimaryLogPG::record_write_error(OpRequestRef op, const hobject_t &soid,
       int flags = m->get_flags() & (CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
       MOSDOpReply *reply = orig_reply.detach();
       if (reply == nullptr) {
-       reply = new MOSDOpReply(m, r, pg->get_osdmap()->get_epoch(),
+       reply = new MOSDOpReply(m, r, pg->get_osdmap_epoch(),
                                flags, true);
       }
       ldpp_dout(pg, 10) << " sending commit on " << *m << " " << reply << dendl;
@@ -3023,7 +3023,7 @@ void PrimaryLogPG::do_cache_redirect(OpRequestRef op)
 {
   const MOSDOp *m = static_cast<const MOSDOp*>(op->get_req());
   int flags = m->get_flags() & (CEPH_OSD_FLAG_ACK|CEPH_OSD_FLAG_ONDISK);
-  MOSDOpReply *reply = new MOSDOpReply(m, -ENOENT, get_osdmap()->get_epoch(),
+  MOSDOpReply *reply = new MOSDOpReply(m, -ENOENT, get_osdmap_epoch(),
                                        flags, false);
   request_redirect_t redir(m->get_object_locator(), pool.info.tier_of);
   reply->set_redirect(redir);
@@ -3238,7 +3238,7 @@ void PrimaryLogPG::finish_proxy_read(hobject_t oid, ceph_tid_t tid, int r)
 
   const MOSDOp *m = static_cast<const MOSDOp*>(op->get_req());
   OpContext *ctx = new OpContext(op, m->get_reqid(), &prdop->ops, this);
-  ctx->reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0, false);
+  ctx->reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, false);
   ctx->user_at_version = prdop->user_version;
   ctx->data_off = prdop->data_offset;
   ctx->ignore_log_op_stats = true;
@@ -3410,7 +3410,7 @@ void PrimaryLogPG::do_proxy_chunked_op(OpRequestRef op, const hobject_t& missing
       if (!chunk_index && !chunk_length) {
        if (cursor == osd_op->op.extent.offset) {
          OpContext *ctx = new OpContext(op, m->get_reqid(), &m->ops, this);                                        
-         ctx->reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0, false);                                 
+         ctx->reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, false);
          ctx->data_off = osd_op->op.extent.offset;                                                                
          ctx->ignore_log_op_stats = true;                                                                         
          complete_read_ctx(0, ctx);                                                                               
@@ -3686,7 +3686,7 @@ void PrimaryLogPG::finish_proxy_write(hobject_t oid, ceph_tid_t tid, int r)
     if (reply)
       pwop->ctx->reply = NULL;
     else {
-      reply = new MOSDOpReply(m, r, get_osdmap()->get_epoch(), 0, true);
+      reply = new MOSDOpReply(m, r, get_osdmap_epoch(), 0, true);
       reply->set_reply_versions(eversion_t(), pwop->user_version);
     }
     reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
@@ -4164,8 +4164,8 @@ void PrimaryLogPG::do_scan(
        queue_peering_event(
          PGPeeringEventRef(
            std::make_shared<PGPeeringEvent>(
-             get_osdmap()->get_epoch(),
-             get_osdmap()->get_epoch(),
+             get_osdmap_epoch(),
+             get_osdmap_epoch(),
              BackfillTooFull())));
        return;
       }
@@ -4182,7 +4182,7 @@ void PrimaryLogPG::do_scan(
       MOSDPGScan *reply = new MOSDPGScan(
        MOSDPGScan::OP_SCAN_DIGEST,
        pg_whoami,
-       get_osdmap()->get_epoch(), m->query_epoch,
+       get_osdmap_epoch(), m->query_epoch,
        spg_t(info.pgid.pgid, get_primary().shard), bi.begin, bi.end);
       encode(bi.objects, reply->get_data());
       osd->send_message_osd_cluster(reply, m->get_connection());
@@ -4234,7 +4234,7 @@ void PrimaryLogPG::do_backfill(OpRequestRef op)
 
       MOSDPGBackfill *reply = new MOSDPGBackfill(
        MOSDPGBackfill::OP_BACKFILL_FINISH_ACK,
-       get_osdmap()->get_epoch(),
+       get_osdmap_epoch(),
        m->query_epoch,
        spg_t(info.pgid.pgid, get_primary().shard));
       reply->set_priority(get_recovery_op_priority());
@@ -4242,8 +4242,8 @@ void PrimaryLogPG::do_backfill(OpRequestRef op)
       queue_peering_event(
        PGPeeringEventRef(
          std::make_shared<PGPeeringEvent>(
-           get_osdmap()->get_epoch(),
-           get_osdmap()->get_epoch(),
+           get_osdmap_epoch(),
+           get_osdmap_epoch(),
            RecoveryDone())));
     }
     // fall-thru
@@ -6309,7 +6309,7 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
 
        notify_info_t n;
        n.timeout = timeout;
-       n.notify_id = osd->get_next_id(get_osdmap()->get_epoch());
+       n.notify_id = osd->get_next_id(get_osdmap_epoch());
        n.cookie = op.watch.cookie;
         n.bl = bl;
        ctx->notifies.push_back(n);
@@ -8829,7 +8829,7 @@ void PrimaryLogPG::fill_in_copy_get_noent(OpRequestRef& op, hobject_t oid,
   dout(20) << __func__ << " got reqids " << reply_obj.reqids << dendl;
   encode(reply_obj, osd_op.outdata, features);
   osd_op.rval = -ENOENT;
-  MOSDOpReply *reply = new MOSDOpReply(m, 0, get_osdmap()->get_epoch(), 0, false);
+  MOSDOpReply *reply = new MOSDOpReply(m, 0, get_osdmap_epoch(), 0, false);
   reply->claim_op_out_data(m->ops);
   reply->set_result(-ENOENT);
   reply->add_flags(CEPH_OSD_FLAG_ACK | CEPH_OSD_FLAG_ONDISK);
@@ -10624,13 +10624,13 @@ void PrimaryLogPG::submit_log_entries(
            entries,
            spg_t(info.pgid.pgid, i->shard),
            pg_whoami.shard,
-           get_osdmap()->get_epoch(),
+           get_osdmap_epoch(),
            last_peering_reset,
            repop->rep_tid,
            pg_trim_to,
            min_last_complete_ondisk);
          osd->send_message_osd_cluster(
-           peer.osd, m, get_osdmap()->get_epoch());
+           peer.osd, m, get_osdmap_epoch());
          waiting_on.insert(peer);
        } else {
          MOSDPGLog *m = new MOSDPGLog(
@@ -10641,7 +10641,7 @@ void PrimaryLogPG::submit_log_entries(
          m->log.tail = old_last_update;
          m->log.head = info.last_update;
          osd->send_message_osd_cluster(
-           peer.osd, m, get_osdmap()->get_epoch());
+           peer.osd, m, get_osdmap_epoch());
        }
       }
       ceph_tid_t rep_tid = repop->rep_tid;
@@ -10677,7 +10677,7 @@ void PrimaryLogPG::submit_log_entries(
        }
       };
       t.register_on_commit(
-       new OnComplete{this, rep_tid, get_osdmap()->get_epoch()});
+       new OnComplete{this, rep_tid, get_osdmap_epoch()});
       int r = osd->store->queue_transaction(ch, std::move(t), NULL);
       ceph_assert(r == 0);
       op_applied(info.last_update);
@@ -11360,7 +11360,7 @@ int PrimaryLogPG::recover_missing(
     start_recovery_op(soid);
     ceph_assert(!recovering.count(soid));
     recovering.insert(make_pair(soid, ObjectContextRef()));
-    epoch_t cur_epoch = get_osdmap()->get_epoch();
+    epoch_t cur_epoch = get_osdmap_epoch();
     remove_missing_object(soid, v, new FunctionContext(
      [=](int) {
        lock();
@@ -11442,7 +11442,7 @@ void PrimaryLogPG::remove_missing_object(const hobject_t &soid,
   recovery_info.soid = soid;
   recovery_info.version = v;
 
-  epoch_t cur_epoch = get_osdmap()->get_epoch();
+  epoch_t cur_epoch = get_osdmap_epoch();
   t.register_on_complete(new FunctionContext(
      [=](int) {
        lock();
@@ -11497,10 +11497,10 @@ void PrimaryLogPG::_committed_pushed_object(
        osd->send_message_osd_cluster(
          get_primary().osd,
          new MOSDPGTrim(
-           get_osdmap()->get_epoch(),
+           get_osdmap_epoch(),
            spg_t(info.pgid.pgid, get_primary().shard),
            last_complete_ondisk),
-         get_osdmap()->get_epoch());
+         get_osdmap_epoch());
       } else {
        calc_min_last_complete_ondisk();
       }
@@ -11547,7 +11547,7 @@ void PrimaryLogPG::_applied_recovered_object_replica()
        op->get_req()->get_priority(),
        op->get_req()->get_recv_stamp(),
        op->get_req()->get_source().num(),
-       get_osdmap()->get_epoch()));
+       get_osdmap_epoch()));
     scrubber.active_rep_scrub.reset();
   }
 }
@@ -11739,7 +11739,7 @@ void PrimaryLogPG::mark_all_unfound_lost(
 
   ObcLockManager manager;
   eversion_t v = get_next_version();
-  v.epoch = get_osdmap()->get_epoch();
+  v.epoch = get_osdmap_epoch();
   uint64_t num_unfound = missing_loc.num_unfound();
   while (m != mend) {
     const hobject_t &oid(m->first);
@@ -11827,15 +11827,15 @@ void PrimaryLogPG::mark_all_unfound_lost(
          queue_peering_event(
            PGPeeringEventRef(
              std::make_shared<PGPeeringEvent>(
-             get_osdmap()->get_epoch(),
-             get_osdmap()->get_epoch(),
+             get_osdmap_epoch(),
+             get_osdmap_epoch(),
              DoRecovery())));
        } else if (is_backfill_unfound()) {
          queue_peering_event(
            PGPeeringEventRef(
              std::make_shared<PGPeeringEvent>(
-             get_osdmap()->get_epoch(),
-             get_osdmap()->get_epoch(),
+             get_osdmap_epoch(),
+             get_osdmap_epoch(),
              RequestBackfill())));
        } else {
          queue_recovery();
@@ -12022,16 +12022,16 @@ void PrimaryLogPG::on_activate()
     queue_peering_event(
       PGPeeringEventRef(
        std::make_shared<PGPeeringEvent>(
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          DoRecovery())));
   } else if (needs_backfill()) {
     dout(10) << "activate queueing backfill" << dendl;
     queue_peering_event(
       PGPeeringEventRef(
        std::make_shared<PGPeeringEvent>(
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          RequestBackfill())));
   } else {
     dout(10) << "activate all replicas clean, no recovery" << dendl;
@@ -12039,8 +12039,8 @@ void PrimaryLogPG::on_activate()
     queue_peering_event(
       PGPeeringEventRef(
        std::make_shared<PGPeeringEvent>(
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          AllReplicasRecovered())));
   }
 
@@ -12373,8 +12373,8 @@ bool PrimaryLogPG::start_recovery_ops(
        queue_peering_event(
          PGPeeringEventRef(
            std::make_shared<PGPeeringEvent>(
-             get_osdmap()->get_epoch(),
-             get_osdmap()->get_epoch(),
+             get_osdmap_epoch(),
+             get_osdmap_epoch(),
              RequestBackfill())));
       }
       deferred_backfill = true;
@@ -12428,8 +12428,8 @@ bool PrimaryLogPG::start_recovery_ops(
       queue_peering_event(
         PGPeeringEventRef(
           std::make_shared<PGPeeringEvent>(
-            get_osdmap()->get_epoch(),
-            get_osdmap()->get_epoch(),
+            get_osdmap_epoch(),
+            get_osdmap_epoch(),
             RequestBackfill())));
     } else {
       dout(10) << "recovery done, no backfill" << dendl;
@@ -12438,8 +12438,8 @@ bool PrimaryLogPG::start_recovery_ops(
       queue_peering_event(
         PGPeeringEventRef(
           std::make_shared<PGPeeringEvent>(
-            get_osdmap()->get_epoch(),
-            get_osdmap()->get_epoch(),
+            get_osdmap_epoch(),
+            get_osdmap_epoch(),
             AllReplicasRecovered())));
     }
   } else { // backfilling
@@ -12451,8 +12451,8 @@ bool PrimaryLogPG::start_recovery_ops(
     queue_peering_event(
       PGPeeringEventRef(
         std::make_shared<PGPeeringEvent>(
-          get_osdmap()->get_epoch(),
-          get_osdmap()->get_epoch(),
+          get_osdmap_epoch(),
+          get_osdmap_epoch(),
           Backfilled())));
   }
 
@@ -12550,7 +12550,7 @@ uint64_t PrimaryLogPG::recover_primary(uint64_t max, ThreadPool::TPHandle &handl
              t.register_on_applied(new C_OSD_AppliedRecoveredObject(this, obc));
              t.register_on_commit(new C_OSD_CommittedPushedObject(
                                     this,
-                                    get_osdmap()->get_epoch(),
+                                    get_osdmap_epoch(),
                                     info.last_complete));
              osd->store->queue_transaction(ch, std::move(t));
              continue;
@@ -12980,12 +12980,12 @@ uint64_t PrimaryLogPG::recover_backfill(
       if (pbi.begin <= backfill_info.begin &&
          !pbi.extends_to_end() && pbi.empty()) {
        dout(10) << " scanning peer osd." << bt << " from " << pbi.end << dendl;
-       epoch_t e = get_osdmap()->get_epoch();
+       epoch_t e = get_osdmap_epoch();
        MOSDPGScan *m = new MOSDPGScan(
          MOSDPGScan::OP_SCAN_GET_DIGEST, pg_whoami, e, last_peering_reset,
          spg_t(info.pgid.pgid, bt.shard),
          pbi.end, hobject_t());
-       osd->send_message_osd_cluster(bt.osd, m, get_osdmap()->get_epoch());
+       osd->send_message_osd_cluster(bt.osd, m, get_osdmap_epoch());
        ceph_assert(waiting_on_backfill.find(bt) == waiting_on_backfill.end());
        waiting_on_backfill.insert(bt);
         sent_scan = true;
@@ -13154,7 +13154,7 @@ uint64_t PrimaryLogPG::recover_backfill(
     } else {
       m = reqs[peer] = new MOSDPGBackfillRemove(
        spg_t(info.pgid.pgid, peer.shard),
-       get_osdmap()->get_epoch());
+       get_osdmap_epoch());
     }
     m->ls.push_back(make_pair(oid, v));
 
@@ -13163,7 +13163,7 @@ uint64_t PrimaryLogPG::recover_backfill(
   }
   for (auto p : reqs) {
     osd->send_message_osd_cluster(p.first.osd, p.second,
-                                 get_osdmap()->get_epoch());
+                                 get_osdmap_epoch());
   }
 
   pgbackend->run_recovery_op(h, get_recovery_op_priority());
@@ -13220,7 +13220,7 @@ uint64_t PrimaryLogPG::recover_backfill(
 
     if (new_last_backfill > pinfo.last_backfill) {
       pinfo.set_last_backfill(new_last_backfill);
-      epoch_t e = get_osdmap()->get_epoch();
+      epoch_t e = get_osdmap_epoch();
       MOSDPGBackfill *m = NULL;
       if (pinfo.last_backfill.is_max()) {
         m = new MOSDPGBackfill(
@@ -13244,7 +13244,7 @@ uint64_t PrimaryLogPG::recover_backfill(
       }
       m->last_backfill = pinfo.last_backfill;
       m->stats = pinfo.stats;
-      osd->send_message_osd_cluster(bt.osd, m, get_osdmap()->get_epoch());
+      osd->send_message_osd_cluster(bt.osd, m, get_osdmap_epoch());
       dout(10) << " peer " << bt
               << " num_objects now " << pinfo.stats.stats.sum.num_objects
               << " / " << info.stats.stats.sum.num_objects << dendl;
@@ -15118,8 +15118,8 @@ int PrimaryLogPG::rep_repair_primary_object(const hobject_t& soid, OpContext *ct
     queue_peering_event(
         PGPeeringEventRef(
          std::make_shared<PGPeeringEvent>(
-         get_osdmap()->get_epoch(),
-         get_osdmap()->get_epoch(),
+         get_osdmap_epoch(),
+         get_osdmap_epoch(),
          DoRecovery())));
   } else {
     // A prior error must have already cleared clean state and queued recovery
index 2d96220f9f1f20fd408fea11ef0ce4978967e682..977ec6817183349833e1aa38872d391013083aa0 100644 (file)
@@ -313,7 +313,7 @@ public:
     GenContext<ThreadPool::TPHandle&> *c) override;
     
   void send_message(int to_osd, Message *m) override {
-    osd->send_message_osd_cluster(to_osd, m, get_osdmap()->get_epoch());
+    osd->send_message_osd_cluster(to_osd, m, get_osdmap_epoch());
   }
   void queue_transaction(ObjectStore::Transaction&& t,
                         OpRequestRef op) override {
@@ -1621,7 +1621,7 @@ private:
        std::lock_guard l(pg->osd->sleep_lock);
        wakeup = pg->osd->sleep_timer.add_event_after(
          pg->cct->_conf->osd_snap_trim_sleep,
-         new OnTimer{pg, pg->get_osdmap()->get_epoch()});
+         new OnTimer{pg, pg->get_osdmap_epoch()});
       } else {
        post_event(SnapTrimTimerReady());
       }
index fb93bf9a587888aa12e1d655dc66993621430828..6141d8914b4f23ca9587ed79ed271cde25eb75be 100644 (file)
@@ -1753,7 +1753,7 @@ void ReplicatedBackend::send_pushes(int prio, map<pg_shard_t, vector<PushOp> > &
        ++i) {
     ConnectionRef con = get_parent()->get_con_osd_cluster(
       i->first.osd,
-      get_osdmap()->get_epoch());
+      get_osdmap_epoch());
     if (!con)
       continue;
     vector<PushOp>::iterator j = i->second.begin();
@@ -1763,7 +1763,7 @@ void ReplicatedBackend::send_pushes(int prio, map<pg_shard_t, vector<PushOp> > &
       MOSDPGPush *msg = new MOSDPGPush();
       msg->from = get_parent()->whoami_shard();
       msg->pgid = get_parent()->primary_spg_t();
-      msg->map_epoch = get_osdmap()->get_epoch();
+      msg->map_epoch = get_osdmap_epoch();
       msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
       msg->set_priority(prio);
       for (;
@@ -1790,7 +1790,7 @@ void ReplicatedBackend::send_pulls(int prio, map<pg_shard_t, vector<PullOp> > &p
        ++i) {
     ConnectionRef con = get_parent()->get_con_osd_cluster(
       i->first.osd,
-      get_osdmap()->get_epoch());
+      get_osdmap_epoch());
     if (!con)
       continue;
     dout(20) << __func__ << ": sending pulls " << i->second
@@ -1799,7 +1799,7 @@ void ReplicatedBackend::send_pulls(int prio, map<pg_shard_t, vector<PullOp> > &p
     msg->from = parent->whoami_shard();
     msg->set_priority(prio);
     msg->pgid = get_parent()->primary_spg_t();
-    msg->map_epoch = get_osdmap()->get_epoch();
+    msg->map_epoch = get_osdmap_epoch();
     msg->min_epoch = get_parent()->get_last_peering_reset_epoch();
     msg->set_pulls(&i->second);
     msg->compute_cost(cct);