Skip to content

Commit

Permalink
ReplicatedPG: fail a non-blocking flush if the object is being scrubbed
Browse files Browse the repository at this point in the history
Fixes: #8011
Backport: firefly, giant
Signed-off-by: Samuel Just <sjust@redhat.com>
  • Loading branch information
athanatos committed Dec 11, 2014
1 parent 4be687b commit 9b26de3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/osd/ReplicatedPG.cc
Expand Up @@ -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.
Expand Down

0 comments on commit 9b26de3

Please sign in to comment.