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
Many empty memtables are created during MyRocks create index #12179
Comments
@rockeet would like to get started in contributing to rocksdb. Shall I assign this to myself? |
Sure, thanks for your contribution! |
@rockeet, I was going through the code. One thing I noticed was, isEmpty() check is absent before calling SwitchMemtable() in FlushMemTable() while rest all invocations of SwitchMemtable() has the check .( rocksdb/db/db_impl/db_impl_compaction_flush.cc Line 2344 in 1de6940
Let me know if I am going in the right direction. Thanks! |
@rockeet Can you tell me how can I reproduce this issue? |
In MyRocks, create many indexes in parallel on existing large table while heavily writing to another table. |
PR #12230 did not fix the issue, we applied the PR to our branch, the issue still exists: The gray text is empty MemTable. |
Are they still created in |
@rockeet I am trying to repro within RocksDB by writing a simple program. My intention is to check if Ingestion + write load is calling IngestExternalFiles -> FlushMemTable -> SwitchMemtable and also verify if at any time the memtable size is 0. I am having a hard time trying to reproing the issue. Am I missing something from trying to repro in RocksDB? I am not familiar with the MyRocks setup and functionalities. It would be great if you could share me your setup or the steps that you followed. |
Your setup missed long lived iterators scanning the db while writting db. |
Got it. missed this part. let me try adding it. |
@rockeet I added live iterators as well but couldn't get it to reproduce. The way I am checking is verifying if Memtable size is 0 in SwitchMemtable().. (ingesting multiple files with 1000+ keys and 10k concurrent writes and 1 iterator trying to read). This is the sample test that I am writing. Would you recommend any changes to the test or the way I am verifying if there are empty memtables?
|
Expected behavior
New MemTable should not be created if there are empty memtables.
Actual behavior
Many new (empty) MemTables are created during MyRocks create index. This is a benign bug, these empty MemTables are deleted on create index finishes.
Steps to reproduce the behavior
In MyRocks, create many indexes in parallel on existing large table while heavily writing to another table.
It seems these MemTables are created in
IngestExternalFiles
->FlushMemTable
->SwitchMemtable
.We found this bug by our webview inspector for DB, gray are empty MemTables:
These empty MemTables get deleted:
The text was updated successfully, but these errors were encountered: