Fix DBFlushTest::ManualFlushWithMinWriteBufferNumberToMerge dead lock
Summary: In the test, there can be a dead lock between background flush thread and foreground main thread as following: * background flush thread: - holding db mutex, while - waiting on "DBImpl::FlushMemTableToOutputFile:BeforeInstallSV" sync point. * foreground thread: - waiting for db mutex to write "key2" Fixing by let background flush thread wait without holding db mutex. Closes https://github.com/facebook/rocksdb/pull/3436 Differential Revision: D6841334 Pulled By: yiwu-arbug fbshipit-source-id: b020768ac94e166e40953c5d09e505515a5f244d
This commit is contained in:
parent
3073b1c573
commit
4bdf06e78f
@ -137,7 +137,7 @@ TEST_F(DBFlushTest, ManualFlushWithMinWriteBufferNumberToMerge) {
|
|||||||
{{"DBImpl::BGWorkFlush",
|
{{"DBImpl::BGWorkFlush",
|
||||||
"DBFlushTest::ManualFlushWithMinWriteBufferNumberToMerge:1"},
|
"DBFlushTest::ManualFlushWithMinWriteBufferNumberToMerge:1"},
|
||||||
{"DBFlushTest::ManualFlushWithMinWriteBufferNumberToMerge:2",
|
{"DBFlushTest::ManualFlushWithMinWriteBufferNumberToMerge:2",
|
||||||
"DBImpl::FlushMemTableToOutputFile:BeforeInstallSV"}});
|
"FlushJob::WriteLevel0Table"}});
|
||||||
SyncPoint::GetInstance()->EnableProcessing();
|
SyncPoint::GetInstance()->EnableProcessing();
|
||||||
|
|
||||||
ASSERT_OK(Put("key1", "value1"));
|
ASSERT_OK(Put("key1", "value1"));
|
||||||
|
@ -134,7 +134,6 @@ Status DBImpl::FlushMemTableToOutputFile(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (s.ok()) {
|
if (s.ok()) {
|
||||||
TEST_SYNC_POINT("DBImpl::FlushMemTableToOutputFile:BeforeInstallSV");
|
|
||||||
InstallSuperVersionAndScheduleWork(cfd, &job_context->superversion_context,
|
InstallSuperVersionAndScheduleWork(cfd, &job_context->superversion_context,
|
||||||
mutable_cf_options);
|
mutable_cf_options);
|
||||||
if (made_progress) {
|
if (made_progress) {
|
||||||
|
Loading…
Reference in New Issue
Block a user