]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore: allow multiple DeferredBatches in flight at once
authorSage Weil <sage@redhat.com>
Thu, 3 Aug 2017 14:03:45 +0000 (10:03 -0400)
committerSage Weil <sage@redhat.com>
Fri, 4 Aug 2017 02:54:18 +0000 (22:54 -0400)
commitca32d575eb2673737198a63643d5d1923151eba3
treeb9cf9eb897929a800b83e6298bff90fe315dfd6f
parentd919987caaabe858feb6113e3b29bcba2c3ded37
os/bluestore: allow multiple DeferredBatches in flight at once

The current code only allows two DeferredBatches per osr: one that is
accumulating new writes and one that is currently in flight to disk.  If
the previous batch is in flight ot disk, then the currently accumulating
one can't also be queued for disk.

This can cause problems, notably that described in
http://tracker.ceph.com/issues/20295, where one transaction is trying to
grab deferred_throttle but cannot due to other in-progress txcs that
include deferred IO.  The short version is that it cannot queue all of the
IO needed, and that later when the IO does complete it is awkward to
determine whether other IO queued behind it also needs to be queued
immediately.  And since it's not, this leads to a deadlock/stall.

Simply allowing multiple batches of IO to be in flight at once is a simple
fix.  Specifically, in queue_transactions(), if throttle_deferred_bytes
get_or_fail() fails, we can now deferred_submit_all() and be sure that
other IO will be submitted and thus complete and release the throttle that
we need to continue.

It is possible that the deferred_aggressive behavior could be simplified
now that the old restriction is dropped, but that needs a closer review
of the code.

Fixes: http://tracker.ceph.com/issues/20295
Signed-off-by: Sage Weil <sage@redhat.com>
src/os/bluestore/BlueStore.cc
src/os/bluestore/BlueStore.h