]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/: remove OSDService::check_osdmap_full, fix caller
authorSamuel Just <sjust@redhat.com>
Fri, 29 Mar 2019 22:56:44 +0000 (15:56 -0700)
committersjust@redhat.com <sjust@redhat.com>
Wed, 1 May 2019 18:22:21 +0000 (11:22 -0700)
PeeringState was the only remaining caller -- both the interface in
PGBackend and the pass-through in PrimaryLogPG were actually unused.
Further, the WaitLocalRecoveryReserved user does not appear to actually
require the fresh-off-of-the-wire osdmap available from OSDService.
As such, moved the logic into OSDMap itself and simply used the
PG local osdmap.

Note, the above is a change in behavior that probably could use a second
opinion.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/OSD.cc
src/osd/OSD.h
src/osd/OSDMap.h
src/osd/PGBackend.h
src/osd/PeeringState.cc
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index 14e3fea5767f3c479edd1e117f982b1500df7410..8fa0e0796638b2f0edf58649719f8c00a7c43dca 100644 (file)
@@ -980,16 +980,6 @@ float OSDService::compute_adjusted_ratio(osd_stat_t new_stat, float *pratio,
   return ((float)new_stat.statfs.get_used()) / ((float)new_stat.statfs.total);
 }
 
-bool OSDService::check_osdmap_full(const set<pg_shard_t> &missing_on)
-{
-  OSDMapRef osdmap = get_osdmap();
-  for (auto shard : missing_on) {
-    if (osdmap->get_state(shard.osd) & CEPH_OSD_FULL)
-      return true;
-  }
-  return false;
-}
-
 void OSDService::send_message_osd_cluster(int peer, Message *m, epoch_t from_epoch)
 {
   OSDMapRef next_map = get_nextmap_reserved();
index 9d2a4b5bcb0d83342f9674fd48ec91c18e5bfbc2..d7f334ebdd6a2af08ccbe3f528acd47c8b6e4d78 100644 (file)
@@ -971,7 +971,6 @@ public:
   bool is_nearfull() const;
   bool need_fullness_update();  ///< osdmap state needs update
   void set_injectfull(s_names type, int64_t count);
-  bool check_osdmap_full(const set<pg_shard_t> &missing_on);
 
 
   // -- epochs --
index 2236dea316a3b8d9041de84fc6cfda6934d6a0a6..d189399afae5a1f98b7226811186732665683253 100644 (file)
@@ -1401,6 +1401,14 @@ public:
       pg_upmap_items.count(pg);
   }
 
+  bool check_full(const set<pg_shard_t> &missing_on) const {
+    for (auto shard : missing_on) {
+      if (get_state(shard.osd) & CEPH_OSD_FULL)
+       return true;
+    }
+    return false;
+  }
+
   /*
    * handy helpers to build simple maps...
    */
index b48cbfb1bd4af38c4cfe18ef171d6c8a1866c715..6ea782bd75e1e9ce454ae664de58d1b54d122a12 100644 (file)
@@ -294,8 +294,6 @@ typedef std::shared_ptr<const OSDMap> OSDMapRef;
 
      virtual bool check_failsafe_full() = 0;
 
-     virtual bool check_osdmap_full(const set<pg_shard_t> &missing_on) = 0;
-
      virtual bool pg_is_repair() = 0;
      virtual void inc_osd_stat_repaired() = 0;
      virtual bool pg_is_remote_backfilling() = 0;
index 4d3451f18aab7b90f40644ef0345b2a4cca98434..a546ea0754b2a87b8b4c9b13f133683e09020661 100644 (file)
@@ -2147,7 +2147,7 @@ PeeringState::WaitLocalRecoveryReserved::WaitLocalRecoveryReserved(my_context ct
 
   // Make sure all nodes that part of the recovery aren't full
   if (!ps->cct->_conf->osd_debug_skip_full_check_in_recovery &&
-      ps->pg->osd->check_osdmap_full(ps->acting_recovery_backfill)) {
+      ps->get_osdmap()->check_full(ps->acting_recovery_backfill)) {
     post_event(RecoveryTooFull());
     return;
   }
index 09f6845e6c91571d24d3071930bcede1d767c827..b0e2e817de2cf8990e01e979369e05c9f760d323 100644 (file)
@@ -15174,11 +15174,6 @@ void PrimaryLogPG::_scrub_finish()
     object_contexts.clear();
 }
 
-bool PrimaryLogPG::check_osdmap_full(const set<pg_shard_t> &missing_on)
-{
-    return osd->check_osdmap_full(missing_on);
-}
-
 int PrimaryLogPG::rep_repair_primary_object(const hobject_t& soid, OpContext *ctx)
 {
   OpRequestRef op = ctx->op;
index e31a099fb5fc3b0156b6ebbb855b8921e3ec3b12..6d0bd4315b1bf1ebe914b80e3e4ed1bf4497ae37 100644 (file)
@@ -1868,7 +1868,6 @@ public:
   void on_removal(ObjectStore::Transaction *t) override;
   void on_shutdown() override;
   bool check_failsafe_full() override;
-  bool check_osdmap_full(const set<pg_shard_t> &missing_on) override;
   bool maybe_preempt_replica_scrub(const hobject_t& oid) override {
     return write_blocked_by_scrub(oid);
   }