-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[BUG]FlushMemTable races with each other and crashes under DEBUG mode #7340
Comments
Thanks @wolfkdy for reporting. We can schedule multiple bg threads and each of them flushes one column family. Will submit a fix for this. update |
facebook-github-bot
pushed a commit
that referenced
this issue
Dec 2, 2020
Summary: #7340 reports and reproduces an assertion failure caused by a combination of the following: - atomic flush is disabled. - a column family can appear multiple times in the flush queue at the same time. This behavior was introduced in release 5.17. Consequently, it is possible that two flushes race with each other. One bg flush thread flushes all memtables. The other thread calls `FlushMemTableToOutputFile()` afterwards, and hits the assertion error below. ``` assert(cfd->imm()->NumNotFlushed() != 0); assert(cfd->imm()->IsFlushPending()); ``` Fix this by reverting the behavior. In non-atomic-flush case, a column family can appear in the flush queue at most once at the same time. Pull Request resolved: #7362 Test Plan: make check Also run stress test successfully for 10 times. ``` make crash_test ``` Reviewed By: ajkr Differential Revision: D25172996 Pulled By: riversand963 fbshipit-source-id: f1559b6366cc609e961e3fc83fae548f1fad08ce
codingrhythm
pushed a commit
to SafetyCulture/rocksdb
that referenced
this issue
Mar 5, 2021
Summary: facebook#7340 reports and reproduces an assertion failure caused by a combination of the following: - atomic flush is disabled. - a column family can appear multiple times in the flush queue at the same time. This behavior was introduced in release 5.17. Consequently, it is possible that two flushes race with each other. One bg flush thread flushes all memtables. The other thread calls `FlushMemTableToOutputFile()` afterwards, and hits the assertion error below. ``` assert(cfd->imm()->NumNotFlushed() != 0); assert(cfd->imm()->IsFlushPending()); ``` Fix this by reverting the behavior. In non-atomic-flush case, a column family can appear in the flush queue at most once at the same time. Pull Request resolved: facebook#7362 Test Plan: make check Also run stress test successfully for 10 times. ``` make crash_test ``` Reviewed By: ajkr Differential Revision: D25172996 Pulled By: riversand963 fbshipit-source-id: f1559b6366cc609e961e3fc83fae548f1fad08ce
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this issue is duplicated with #5126
I open another ticket as the previous one is opened one year ago and seems untracked now as no one contributed a unittest.
this issue won't be a problem in release mode as asserts are eliminated.
The two asserts won't be held.
Steps to reproduce the behavior
these steps have been constributed into the unittest below, which can reproduce the two asserts.
The test works under 5.18.3, I guess it should also work under master branch.
The text was updated successfully, but these errors were encountered: