-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
SIGSEGV on RocksJava #1267
Comments
Let me further check whether putting hash index into block cache is supported or not. I'm not sure it is supported. |
Is it possible for you to try version 4.9 or newer? I want to rule out some bugs that we fixed in 4.9. I was not able to reproduce the issue in the unit test. Some more information of the failure will be helpful. |
@siying @ifndef-SleePy The line number can be retrieved by using |
@siying @adamretter |
@siying @adamretter Thanks for reply. The comment of @hedengcheng shows more details about this problem. Do you have any idea? |
@hedengcheng which RocksDB version is it? We may have fixed something in 4.9 related to this. |
To explain more, the call stack shows that the index block in the block cache out-lived the table reader. It can happen in three cases: table reader is evicted by table cache, the DB is reopened in the same process, or you opened the same DB twice with the same block cache in the same process. The last case is rare so I assume it's not the case. We have some change in 4.9 that clears up the cached index block in the first two cases. If you are running 4.8 or earlier, I suggest you retry 4.9 or later. You are running 4.9 or later, we need to investigate more. |
Sorry I thought 4.9 has been official released but just realized that we haven't published release note yet. We will do it soon and the tag "v4.9" is ready to use already. |
@ifndef-SleePy @hedengcheng RocksJava 4.9.0 binaries are now on their way to Maven Central :-) |
Sounds great, we have tested it in version 4.2 and 4.5.1. We will test it in 4.9. Thanks a lot! |
RocksJava 4.9.0 has the similar error:
The options we use
it will crash after processing some data |
@siying @adamretter Bug description:Suppose two threads, Thread A and Thread B, read the same sstable's prefix index block (BlockBasedTable::NewIndexIterator), but not find the cache_handle in the block_cache. So both of thread A and B enter to create index reader (BlockBasedTable::CreateIndexReader, core code below):
Fix method:If we can't find cache_handle in block_cache, there is only one thread can enter to create the index reader, no two threads can create it simultaneously. So, we need a mutex to protect this operation. We will fix this bug and test in our environment. The pseudocode as below:
|
Following is the backtrace before crash. Thread 0x7fa64edf4700
Thread 0x7fa64f2f9700
Both thread 0x7fa64edf4700 and 0x7fa64f2f9700 are running in index reader create logic, both of them are creating the index reader for sstable /home/***/rocksdb-test/testproject/data/000018.sst. Thread 0x7fa64edf4700 enter first, followed by thread 0x7fa64f2f9700. After thread 0x7fa64f2f9700 finish the creation, Thread 0x7fa64edf4700 has a pointer which released by 0x7fa64f2f9700, cause core dump. |
@hedengcheng thank you for reporting it! We'll fix it. |
Yes, awesome bug report. Thank you for figuring this out. |
Aaron Gao has a diff out for it: https://reviews.facebook.net/D62361 |
@siying Thanks a lot. |
@hedengcheng it's not committed yet... |
Summary: fixed data race described in #1267 and add regression test Test Plan: ./table_test --gtest_filter=BlockBasedTableTest.NewIndexIteratorLeak make all check -j64 core dump before fix. ok after fix. Reviewers: andrewkr, sdong Reviewed By: sdong Subscribers: igor, andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D62361
Summary: fixed data race described in #1267 and add regression test Test Plan: ./table_test --gtest_filter=BlockBasedTableTest.NewIndexIteratorLeak make all check -j64 core dump before fix. ok after fix. Reviewers: andrewkr, sdong Reviewed By: sdong Subscribers: igor, andrewkr, dhruba, leveldb Differential Revision: https://reviews.facebook.net/D62361
done by commit c75f4fa |
We are using rocksdb(0.4.2) in our project. Currently we met some 'core dump' problem. Here is some information about it.
The stack in error file
The options we use
The situation is
The text was updated successfully, but these errors were encountered: