From: Sage Weil Date: Wed, 8 Feb 2017 21:46:10 +0000 (-0500) Subject: osd: fix write_blocked_by_scrub X-Git-Tag: v12.0.1~427^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad4365b73533bd40b601a5dc43187f87ee1ddc10;p=ceph.git osd: fix write_blocked_by_scrub Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.h b/src/osd/PG.h index 019a9b66000c..807efc56c5fe 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -1197,12 +1197,8 @@ public: // classic (non chunk) scrubs block all writes // chunky scrubs only block writes to a range - bool write_blocked_by_scrub(const hobject_t &soid, bool sort_bitwise) { - if (soid >= start && - soid < end) - return true; - - return false; + bool write_blocked_by_scrub(const hobject_t &soid) { + return (soid >= start && soid < end); } // clear all state diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index f703664f36b1..30e718b1b07b 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -1964,7 +1964,7 @@ void PrimaryLogPG::do_op(OpRequestRef& op) } if (write_ordered && - scrubber.write_blocked_by_scrub(head, get_sort_bitwise())) { + scrubber.write_blocked_by_scrub(head)) { dout(20) << __func__ << ": waiting for scrub" << dendl; waiting_for_scrub.push_back(op); op->mark_delayed("waiting for scrub"); @@ -2972,7 +2972,7 @@ void PrimaryLogPG::promote_object(ObjectContextRef obc, { hobject_t hoid = obc ? obc->obs.oi.soid : missing_oid; assert(hoid != hobject_t()); - if (scrubber.write_blocked_by_scrub(hoid, get_sort_bitwise())) { + if (scrubber.write_blocked_by_scrub(hoid)) { dout(10) << __func__ << " " << hoid << " blocked by scrub" << dendl; if (op) { @@ -8174,7 +8174,7 @@ int PrimaryLogPG::try_flush_mark_clean(FlushOpRef fop) } if (!fop->blocking && - scrubber.write_blocked_by_scrub(oid, get_sort_bitwise())) { + scrubber.write_blocked_by_scrub(oid)) { if (fop->op) { dout(10) << __func__ << " blocked by scrub" << dendl; requeue_op(fop->op); @@ -8889,7 +8889,7 @@ void PrimaryLogPG::handle_watch_timeout(WatchRef watch) return; } - if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid, get_sort_bitwise())) { + if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid)) { dout(10) << "handle_watch_timeout waiting for scrub on obj " << obc->obs.oi.soid << dendl; @@ -11529,7 +11529,7 @@ void PrimaryLogPG::hit_set_remove_all() // Once we hit a degraded object just skip if (is_degraded_or_backfilling_object(aoid)) return; - if (scrubber.write_blocked_by_scrub(aoid, get_sort_bitwise())) + if (scrubber.write_blocked_by_scrub(aoid)) return; } @@ -11648,7 +11648,7 @@ void PrimaryLogPG::hit_set_persist() // Once we hit a degraded object just skip further trim if (is_degraded_or_backfilling_object(aoid)) return; - if (scrubber.write_blocked_by_scrub(aoid, get_sort_bitwise())) + if (scrubber.write_blocked_by_scrub(aoid)) return; } @@ -11682,7 +11682,7 @@ void PrimaryLogPG::hit_set_persist() new_hset.using_gmt); // If the current object is degraded we skip this persist request - if (scrubber.write_blocked_by_scrub(oid, get_sort_bitwise())) + if (scrubber.write_blocked_by_scrub(oid)) return; hit_set->seal(); @@ -11926,7 +11926,7 @@ bool PrimaryLogPG::agent_work(int start_max, int agent_flush_quota) osd->logger->inc(l_osd_agent_skip); continue; } - if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid, get_sort_bitwise())) { + if (scrubber.write_blocked_by_scrub(obc->obs.oi.soid)) { dout(20) << __func__ << " skip (scrubbing) " << obc->obs.oi << dendl; osd->logger->inc(l_osd_agent_skip); continue; diff --git a/src/osd/PrimaryLogPG.h b/src/osd/PrimaryLogPG.h index 3553b4d59f08..ff147da30086 100644 --- a/src/osd/PrimaryLogPG.h +++ b/src/osd/PrimaryLogPG.h @@ -821,9 +821,7 @@ protected: if (!to_req.empty()) { // requeue at front of scrub blocking queue if we are blocked by scrub for (auto &&p: to_req) { - if (scrubber.write_blocked_by_scrub( - p.first.get_head(), - get_sort_bitwise())) { + if (scrubber.write_blocked_by_scrub(p.first.get_head())) { waiting_for_scrub.splice( waiting_for_scrub.begin(), p.second,