]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PeeringState: mark state and helpers private
authorSamuel Just <sjust@redhat.com>
Wed, 10 Apr 2019 04:57:56 +0000 (21:57 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:28 +0000 (11:22 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/PG.cc
src/osd/PG.h
src/osd/PeeringState.cc
src/osd/PeeringState.h

index 95997e46fb4a76432a58ba03e27cf8b8284a2a8c..777247ccbc606ea05355a02cc3c6ef0d0654de42 100644 (file)
@@ -178,16 +178,17 @@ void PG::dump_live_ids()
 
 PG::PG(OSDService *o, OSDMapRef curmap,
        const PGPool &_pool, spg_t p) :
+  pg_whoami(osd->whoami, p.shard),
+  pg_id(p),
   recovery_state(
     cct,
+    pg_whoami,
     p,
     _pool,
     curmap,
     this,
     this),
-  pg_whoami(recovery_state.pg_whoami),
   info(recovery_state.get_info()),
-  pg_id(p),
   coll(p),
   osd(o),
   cct(o->cct),
@@ -1193,8 +1194,6 @@ void PG::read_state(ObjectStore *store)
     ceph_abort_msg("PG too old to upgrade");
   }
 
-  recovery_state.last_written_info = info;
-
   recovery_state.init_from_disk_state(
     std::move(info_from_disk),
     std::move(past_intervals_from_disk),
index 8995ca38fd1e7b5c8054c3e07809ad5e8a673ee4..6cc90a2fe06621ef1db337c0b0264a7e92ee9206 100644 (file)
@@ -172,22 +172,21 @@ class PG : public DoutPrefixProvider, public PeeringState::PeeringListener {
   friend class NamedState;
   friend class PeeringState;
 
-protected:
-  PeeringState recovery_state;
 public:
-  using PeeringCtx = PeeringState::PeeringCtx;
+  const pg_shard_t pg_whoami;
+  const spg_t pg_id;
+  PeeringState recovery_state;
 
+  using PeeringCtx = PeeringState::PeeringCtx;
 
 protected:
   /**
-   * Peering state information being moved to PeeringState
+   * Ref to pg_info_t in Peering state
    */
-  pg_shard_t pg_whoami;
   const pg_info_t &info;
 
 public:
   // -- members --
-  const spg_t pg_id;
   const coll_t coll;
 
   ObjectStore::CollectionHandle ch;
@@ -322,7 +321,7 @@ public:
     return recovery_state.get_up_primary();
   }
   const PastIntervals& get_past_intervals() const {
-    return recovery_state.past_intervals;
+    return recovery_state.get_past_intervals();
   }
   bool is_acting_recovery_backfill(pg_shard_t osd) const {
     return recovery_state.is_acting_recovery_backfill(osd);
index 27f91bfce2fcf44f87dadad3df0c7deb5c23f603..53a3a97f3fb42e03d2f3e72fe6ec2cc8945b9760 100644 (file)
@@ -113,6 +113,7 @@ void PeeringState::PeeringMachine::send_query(
 
 PeeringState::PeeringState(
   CephContext *cct,
+  pg_shard_t pg_whoami,
   spg_t spgid,
   const PGPool &_pool,
   OSDMapRef curmap,
@@ -126,6 +127,7 @@ PeeringState::PeeringState(
     orig_ctx(0),
     osdmap_ref(curmap),
     pool(_pool),
+    pg_whoami(pg_whoami),
     info(spgid),
     pg_log(cct),
     missing_loc(spgid, this, dpp, cct)
index 01ecaf17b7aa490c1bb18f801715a549d047a295..0ba13b960f0537124bcb616a3279eeb689c39211 100644 (file)
@@ -1157,7 +1157,6 @@ public:
    */
   boost::optional<PeeringCtx> rctx;
 
-public:
   /**
    * OSDMap state
    */
@@ -1262,14 +1261,10 @@ public:
     osdmap_ref = std::move(newmap);
   }
 
-  void write_if_dirty(ObjectStore::Transaction& t);
-
   void update_heartbeat_peers();
   bool proc_replica_info(
     pg_shard_t from, const pg_info_t &oinfo, epoch_t send_epoch);
   void remove_down_peer_info(const OSDMapRef &osdmap);
-  void purge_strays();
-  void update_history(const pg_history_t& new_history);
   void check_recovery_sources(const OSDMapRef& map);
   void set_last_peering_reset();
   void check_full_transition(OSDMapRef lastmap, OSDMapRef osdmap);
@@ -1286,11 +1281,6 @@ public:
     const vector<int>& newacting, int acting_primary,
     ObjectStore::Transaction *t);
   void on_new_interval();
-  void init_primary_up_acting(
-    const vector<int> &newup,
-    const vector<int> &newacting,
-    int new_up_primary,
-    int new_acting_primary);
   void clear_recovery_state();
   void clear_primary_state();
   void check_past_interval_bounds() const;
@@ -1363,7 +1353,6 @@ public:
     const pg_info_t &oinfo, const pg_missing_t &omissing,
     pg_shard_t fromosd,
     PeeringCtx*);
-  void discover_all_missing(std::map<int, map<spg_t,pg_query_t> > &query_map);
   void build_might_have_unfound();
   void log_weirdness();
   void activate(
@@ -1372,7 +1361,6 @@ public:
     map<int, map<spg_t,pg_query_t> >& query_map,
     map<int, vector<pair<pg_notify_t, PastIntervals> > > *activator_map,
     PeeringCtx *ctx);
-  void share_pg_info();
 
   void rewind_divergent_log(ObjectStore::Transaction& t, eversion_t newhead);
   void merge_log(
@@ -1417,12 +1405,6 @@ public:
   void update_blocked_by();
   void update_calc_stats();
 
-  bool append_log_entries_update_missing(
-    const mempool::osd_pglog::list<pg_log_entry_t> &entries,
-    ObjectStore::Transaction &t,
-    boost::optional<eversion_t> trim_to,
-    boost::optional<eversion_t> roll_forward_to);
-
   void add_log_entry(const pg_log_entry_t& e, bool applied);
 
   void calc_trim_to();
@@ -1431,6 +1413,7 @@ public:
 public:
   PeeringState(
     CephContext *cct,
+    pg_shard_t pg_whoami,
     spg_t spgid,
     const PGPool &pool,
     OSDMapRef curmap,
@@ -1491,6 +1474,13 @@ public:
     log_weirdness();
   }
 
+  void init_primary_up_acting(
+    const vector<int> &newup,
+    const vector<int> &newacting,
+    int new_up_primary,
+    int new_acting_primary);
+
+  void share_pg_info();
 
   void start_split_stats(
     const set<spg_t>& childpgs, vector<object_stat_sum_t> *out);
@@ -1504,11 +1494,14 @@ public:
     unsigned split_bits,
     const pg_merge_meta_t& last_pg_merge_meta);
 
+  void purge_strays();
+
   void update_stats(
     std::function<bool(pg_history_t &, pg_stat_t &)> f,
     ObjectStore::Transaction *t = nullptr);
 
   void update_hset(const pg_hit_set_history_t &hset_history);
+  void update_history(const pg_history_t& new_history);
 
   std::optional<pg_stat_t> prepare_stats_for_publish(
     bool pg_stats_publish_valid,
@@ -1519,7 +1512,7 @@ public:
    * Merge entries updating missing as necessary on all
    * acting_recovery_backfill logs and missings (also missing_loc)
    */
-  void merge_new_log_entries(
+  bool append_log_entries_update_missing(
     const mempool::osd_pglog::list<pg_log_entry_t> &entries,
     ObjectStore::Transaction &t,
     boost::optional<eversion_t> trim_to,
@@ -1533,6 +1526,12 @@ public:
     bool transaction_applied,
     bool async);
 
+  void merge_new_log_entries(
+    const mempool::osd_pglog::list<pg_log_entry_t> &entries,
+    ObjectStore::Transaction &t,
+    boost::optional<eversion_t> trim_to,
+    boost::optional<eversion_t> roll_forward_to);
+
   void add_local_next_event(const pg_log_entry_t& e) {
     pg_log.missing_add_next_entry(e);
   }
@@ -1564,6 +1563,8 @@ public:
     pg_shard_t peer,
     const hobject_t soid);
 
+  void discover_all_missing(std::map<int, map<spg_t,pg_query_t> > &query_map);
+
   void object_recovered(
     const hobject_t &hoid,
     const object_stat_sum_t &stat_diff) {
@@ -1630,6 +1631,8 @@ public:
     pg_log.set_last_requested(v);
   }
 
+  void write_if_dirty(ObjectStore::Transaction& t);
+
   void complete_write(eversion_t v, eversion_t lc);
   void local_write_applied(eversion_t v) {
     last_update_applied = v;