]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/ECBackend: use Listener instead of PG interface to check undersized
authorSage Weil <sage@redhat.com>
Fri, 15 Sep 2017 15:22:53 +0000 (11:22 -0400)
committerSage Weil <sage@redhat.com>
Fri, 6 Oct 2017 18:08:17 +0000 (13:08 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ECBackend.cc
src/osd/PGBackend.h
src/osd/PrimaryLogPG.h

index 18add2370a89dbaa8298a72ac16b5ec7be9400a4..780bdb676b3316f9f8d207429d535b412a32f4c7 100644 (file)
@@ -954,9 +954,9 @@ void ECBackend::handle_sub_write(
     !op.backfill,
     localt);
 
-  PrimaryLogPG *_rPG = dynamic_cast<PrimaryLogPG *>(get_parent());
-  if (_rPG && !_rPG->is_undersized() &&
-      (unsigned)get_parent()->whoami_shard().shard >= ec_impl->get_data_chunk_count())
+  if (!get_parent()->pg_is_undersized() &&
+      (unsigned)get_parent()->whoami_shard().shard >=
+      ec_impl->get_data_chunk_count())
     op.t.set_fadvise_flag(CEPH_OSD_OP_FLAG_FADVISE_DONTNEED);
 
   if (on_local_applied_sync) {
index 33730fb488441a9b3a95269bec557ff4d60ca78c..f957f0f4a5f65c7737ed6565af032eb472595350 100644 (file)
@@ -216,6 +216,8 @@ typedef ceph::shared_ptr<const OSDMap> OSDMapRef;
        pg_shard_t peer,
        const hobject_t &hoid) = 0;
 
+     virtual bool pg_is_undersized() const = 0;
+
      virtual void log_operation(
        const vector<pg_log_entry_t> &logv,
        const boost::optional<pg_hit_set_history_t> &hset_history,
index f2fec82d2f63e094a83922310ef30826ffa9b85c..fbf459f78584b1919599fb41d815f8845f986dc9 100644 (file)
@@ -415,6 +415,10 @@ public:
       assert(is_backfill_targets(peer));
     return should_send;
   }
+
+  bool pg_is_undersized() const override {
+    return is_undersized();
+  }
   
   void update_peer_last_complete_ondisk(
     pg_shard_t fromosd,