]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/BlueFS: fix race with log flush during async log compaction 18503/head
authorSage Weil <sage@redhat.com>
Fri, 20 Oct 2017 13:51:17 +0000 (08:51 -0500)
committerSage Weil <sage@redhat.com>
Tue, 24 Oct 2017 03:31:03 +0000 (22:31 -0500)
commit9f49698fab5de9ade79d3aba957afe82daa4fecc
treeb4368e29b9a147197a6a948f9dae5c9ed79ecca7
parent724a51cd442d35c950414b86608c48936b01b78b
os/bluestore/BlueFS: fix race with log flush during async log compaction

During async log compaction we rely on _flush-and_sync_log to update the
log_writer to jump_to.  However, if racing threads are also trying to flush
the log and manage to flush our new log events for us, then our flush will
turn into a no-op, and we won't update jump_to correctly at all.  This
results in a corrupted log size a bit later one.

Fix by ensuring that there are no in-progress flushes before we add our
log entries.  Also, add asserts to _flush_and_sync_log to make sure we
never bail out early if jump_to is set (which would indicate this or
another similar bug is still present).

Fixes: http://tracker.ceph.com/issues/21878
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 4324c8bc7e66633035c15995e3f82ef91d3a5e8c)
src/os/bluestore/BlueFS.cc