From: Neha Ojha Date: Fri, 5 Jan 2018 20:32:23 +0000 (-0800) Subject: PG: do not block writes on async_recovery_targets X-Git-Tag: v13.1.0~548^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1e2e58c730809f64520f38dfd75009fe1bfb8886;p=ceph.git PG: do not block writes on async_recovery_targets Signed-off-by: Neha Ojha --- diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index 8d3c709f6741..14a92f28fbfb 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -626,10 +626,15 @@ bool PrimaryLogPG::is_degraded_or_backfilling_object(const hobject_t& soid) if (*i == get_primary()) continue; pg_shard_t peer = *i; auto peer_missing_entry = peer_missing.find(peer); + // If an object is missing on an async_recovery_target, return false. + // This will not block the op and the object is async recovered later. if (peer_missing_entry != peer_missing.end() && - peer_missing_entry->second.get_items().count(soid)) - return true; - + peer_missing_entry->second.get_items().count(soid)) { + if (async_recovery_targets.count(peer)) + return false; + else + return true; + } // Object is degraded if after last_backfill AND // we are backfilling it if (is_backfill_targets(peer) && @@ -10073,6 +10078,15 @@ void PrimaryLogPG::issue_repop(RepGather *repop, OpContext *ctx) repop->rep_tid, ctx->reqid, ctx->op); + + for (set::iterator i = async_recovery_targets.begin(); + i != async_recovery_targets.end(); + ++i) { + if (*i == get_primary() || !peer_missing[*i].is_missing(soid)) continue; + for (auto &&entry: ctx->log) { + peer_missing[*i].add_next_event(entry); + } + } } PrimaryLogPG::RepGather *PrimaryLogPG::new_repop( diff --git a/src/osd/ReplicatedBackend.cc b/src/osd/ReplicatedBackend.cc index 43782872a6f8..b9b31bc46d87 100644 --- a/src/osd/ReplicatedBackend.cc +++ b/src/osd/ReplicatedBackend.cc @@ -1004,9 +1004,6 @@ void ReplicatedBackend::do_repop(OpRequestRef op) // sanity checks assert(m->map_epoch >= get_info().history.same_interval_since); - // we better not be missing this. - assert(!parent->get_log().get_missing().is_missing(soid)); - parent->maybe_preempt_replica_scrub(soid); int ackerosd = m->get_source().num();