New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

luminous: os/bluestore/BlueFS: fix race with log flush during async log compaction #18503

Merged
merged 1 commit into from Oct 25, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Member

liewegas commented Oct 24, 2017

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 4324c8b)

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 4324c8b)

@liewegas liewegas changed the title from os/bluestore/BlueFS: fix race with log flush during async log compaction to luminous: os/bluestore/BlueFS: fix race with log flush during async log compaction Oct 24, 2017

@liewegas liewegas added this to the luminous milestone Oct 24, 2017

@liewegas liewegas requested a review from varadakari Oct 24, 2017

@varadakari

LGTM

@liewegas liewegas merged commit 42172a4 into ceph:luminous Oct 25, 2017

4 checks passed

Docs: build check OK - docs built
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment