-
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
[Bug Report] two_write_queue is conflict with IngestExternalFile #5974
Comments
I thank we could use one |
@yiwu-arbug Is this the same problem you faced? |
btw @yiwu-arbug can you take a look at #5716 ? |
@maysamyabandeh @Little-Wallace is @yiwu-arbug 's teammate. So the answer to your question must be no. |
Yes, I was referring to this issue found by @Little-Wallace. |
Sorry it fell off my radar. Will take a look. |
Shall we enable unordered_write in db_crashtest.py? |
Summary: When two_write_queue enable, IngestExternalFile performs EnterUnbatched on both write queues. SwitchMemtable also EnterUnbatched on 2nd write queue when this option is enabled. When the call stack includes IngestExternalFile -> FlushMemTable -> SwitchMemtable, this results into a deadlock. The implemented solution is to pass on the existing writes_stopped argument in FlushMemTable to skip EnterUnbatched in SwitchMemtable. Fixes facebook#5974 Pull Request resolved: facebook#5976 Differential Revision: D18535943 Pulled By: maysamyabandeh fbshipit-source-id: a4f9d4964c10d4a7ca06b1e0102ca2ec395512bc
Summary: When two_write_queue enable, IngestExternalFile performs EnterUnbatched on both write queues. SwitchMemtable also EnterUnbatched on 2nd write queue when this option is enabled. When the call stack includes IngestExternalFile -> FlushMemTable -> SwitchMemtable, this results into a deadlock. The implemented solution is to pass on the existing writes_stopped argument in FlushMemTable to skip EnterUnbatched in SwitchMemtable. Fixes facebook#5974 Pull Request resolved: facebook#5976 Differential Revision: D18535943 Pulled By: maysamyabandeh fbshipit-source-id: a4f9d4964c10d4a7ca06b1e0102ca2ec395512bc
Summary: When two_write_queue enable, IngestExternalFile performs EnterUnbatched on both write queues. SwitchMemtable also EnterUnbatched on 2nd write queue when this option is enabled. When the call stack includes IngestExternalFile -> FlushMemTable -> SwitchMemtable, this results into a deadlock. The implemented solution is to pass on the existing writes_stopped argument in FlushMemTable to skip EnterUnbatched in SwitchMemtable. Fixes facebook#5974 Pull Request resolved: facebook#5976 Differential Revision: D18535943 Pulled By: maysamyabandeh fbshipit-source-id: a4f9d4964c10d4a7ca06b1e0102ca2ec395512bc
Expected behavior
I'm trying to replace
DBImpl
withTransactionDB
to improve our project performance, following the method described in this blog: unordered_write.I enable the param
unordered_write
andtwo_write_queue
to improve performance of write with multiple thread. We expect TransactionDB could perform as DBImpl.Actual behavior
When I ingest one sstable file into TransactionDB, it was blocked.
Steps to reproduce the behavior
Here is my code to reproduce the problem: https://github.com/Little-Wallace/rocksdb/blob/transaction_db/utilities/transactions/write_prepared_transaction_test.cc#L3522
I ingest one sstable which overlap with key range of memtable. Of course, it will trigger one FlushJob of memtable.
I have run
pstack
for the process, and I found that RocksDB waited twice to be leader innonmem_write_thread_
. One leader thread would be blocked if it tries to become leader in a second time.Here is the first time to
EnterUnbatched
: https://github.com/facebook/rocksdb/blob/master/db/db_impl/db_impl.cc#L3817And the second time: https://github.com/facebook/rocksdb/blob/master/db/db_impl/db_impl_write.cc#L1581
The text was updated successfully, but these errors were encountered: