]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
os/bluestore/BlueFS: fix race with log flush during async log compaction 18428/head
authorSage Weil <sage@redhat.com>
Fri, 20 Oct 2017 13:51:17 +0000 (08:51 -0500)
committerSage Weil <sage@redhat.com>
Fri, 20 Oct 2017 13:51:17 +0000 (08:51 -0500)
commit4324c8bc7e66633035c15995e3f82ef91d3a5e8c
treecf5d346457084fafde9e80f2ae80cfb1d1797cdf
parent34951266fe2ccc14ee1503d62e15a9dffad31a5f
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>
src/os/bluestore/BlueFS.cc