]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd/ECBackend: fix on_write ordering w/ sync onreadable callbacks 18196/head
authorSage Weil <sage@redhat.com>
Wed, 18 Oct 2017 02:45:45 +0000 (21:45 -0500)
committerSage Weil <sage@redhat.com>
Tue, 12 Dec 2017 17:21:49 +0000 (11:21 -0600)
commit1908c061496817ee6dbc483186a41a9b373be01c
tree1e0b64baacb95548d0f504e815634ce32ee9e8ec
parentfef5fe8ba07c915072f575fd85ca11884728b2e9
osd/ECBackend: fix on_write ordering w/ sync onreadable callbacks

When we call handle_sub_write after a write completion, we may
do a sync read completion and then call back into check_ops().  Attaching
the on_write events to the op we're applying means that we don't ensure
that the on_write event(s) happen before the next write in the queue
is submitted (when we call back into check_ops()).

For example, if we have op A, on_write event W, then op B, a sync
applied completion would mean that we would queue the write for A, call
back into SubWriteApplied -> handle_sub_write_reply -> check_ops and then
process B... before getting to W.

Resolve this by attaching the on_write callback to a separate Op that is
placed into the queue, just like any other Op.  This keeps the ordering
logic clean, although it is a bit ugly with the polymorphism around Op
being either an Op or an on_write callback.

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/ECBackend.cc
src/osd/ECBackend.h