]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ReplicatedPG: fail a non-blocking flush if the object is being scrubbed 3155/head
authorSamuel Just <sjust@redhat.com>
Thu, 20 Nov 2014 22:27:39 +0000 (14:27 -0800)
committerSamuel Just <sjust@redhat.com>
Thu, 11 Dec 2014 21:30:11 +0000 (13:30 -0800)
Fixes: #8011
Backport: firefly, giant
Signed-off-by: Samuel Just <sjust@redhat.com>
src/osd/ReplicatedPG.cc

index bfceffa50f2d92274975e5faae985745ba5a4bca..b559770db0ccdb9f350ecc10a6049b2c7cd93911 100644 (file)
@@ -6614,6 +6614,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.