]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/ReplicatedPG: carry CopyOpRef in copy_from completion 1797/head
authorSage Weil <sage@inktank.com>
Thu, 8 May 2014 21:19:22 +0000 (14:19 -0700)
committerSage Weil <sage@inktank.com>
Thu, 8 May 2014 21:19:22 +0000 (14:19 -0700)
commit589b639af7c8834a1e6293d58d77a9c440107bc3
treec2441bf369380b07fc1c4bb63c879ef88f5dcd80
parentaff119ace66b7f2cf22f9fcc5e405bb37e5991a7
osd/ReplicatedPG: carry CopyOpRef in copy_from completion

There is a race with copy_from cancellation.  The internal Objecter
completion decodes a bunch of data and copies it into pointers provided
when the op is queued.  When we cancel, we need to ensure that we can cope
until control passes back to our provided completion.

Once we *do* get into the (ReplicatedPG) callbacks, we will bail out
because the tid in the CopyOp or FlushOp no longer matches.

Fix this by carrying a ref to keep the copy-from targets alive, and
clearing out the tids that we cancel.

Note that previously, the trigger for this was that the tid changes when
we handle a redirect, which made the op_cancel() call fail.  With the
coming Objecter changes, this will no longer be the case.  However, there
are also locking and threading changes that will make cancellation racy,
so we will not be able to rely on it always preventing the callback.
Either way, this will avoid the problem.

Fixes: #7588
Signed-off-by: Sage Weil <sage@inktank.com>
src/osd/ReplicatedPG.cc