From: Sage Weil Date: Fri, 15 Sep 2017 15:22:53 +0000 (-0400) Subject: osd/ECBackend: use Listener instead of PG interface to check undersized X-Git-Tag: v13.0.1~634^2~56 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=50a6f3c59cbadd75895c23acf515e7b4cb33e214;p=ceph.git osd/ECBackend: use Listener instead of PG interface to check undersized Signed-off-by: Sage Weil --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index 18add2370a89..780bdb676b33 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -954,9 +954,9 @@ void ECBackend::handle_sub_write( !op.backfill, localt); - PrimaryLogPG *_rPG = dynamic_cast(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) { diff --git a/src/osd/PGBackend.h b/src/osd/PGBackend.h index 33730fb48844..f957f0f4a5f6 100644 --- a/src/osd/PGBackend.h +++ b/src/osd/PGBackend.h @@ -216,6 +216,8 @@ typedef ceph::shared_ptr OSDMapRef; pg_shard_t peer, const hobject_t &hoid) = 0; + virtual bool pg_is_undersized() const = 0; + virtual void log_operation( const vector &logv, const boost::optional &hset_history, diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index f2fec82d2f63..fbf459f78584 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -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,