osd/ECBackend: use Listener instead of PG interface to check undersized

Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-09-15 11:22:53 -04:00
parent 931fc923c3
commit 50a6f3c59c
3 changed files with 9 additions and 3 deletions

View 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) {

View 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,

View 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,