From: Samuel Just Date: Thu, 20 Nov 2014 22:27:39 +0000 (-0800) Subject: ReplicatedPG: fail a non-blocking flush if the object is being scrubbed X-Git-Tag: v0.87.2~22^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=681c99fe12cfa6318f8cf06f4e825805635bcc07;p=ceph.git ReplicatedPG: fail a non-blocking flush if the object is being scrubbed Fixes: #8011 Backport: firefly, giant Signed-off-by: Samuel Just (cherry picked from commit 9b26de3f3653d38dcdfc5b97874089f19d2a59d7) --- diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index 9e5da1ffc80c7..745666e1a4321 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -6616,6 +6616,19 @@ int ReplicatedPG::try_flush_mark_clean(FlushOpRef fop) return -EBUSY; } + if (!fop->blocking && scrubber.write_blocked_by_scrub(oid)) { + if (fop->op) { + dout(10) << __func__ << " blocked by scrub" << dendl; + requeue_op(fop->op); + requeue_ops(fop->dup_ops); + return -EAGAIN; // will retry + } else { + osd->logger->inc(l_osd_tier_try_flush_fail); + cancel_flush(fop, false); + return -ECANCELED; + } + } + // successfully flushed; can we clear the dirty bit? // try to take the lock manually, since we don't // have a ctx yet.