From 72de842ac94e458f3fce9d2516be730d615fac0e Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Fri, 8 Nov 2019 13:45:31 -0800 Subject: [PATCH] Fix DBFlushTest::FireOnFlushCompletedAfterCommittedResult hang (#6018) Summary: The test would fire two flushes to let them run in parallel. Previously it wait for the first job to be scheduled before firing the second. It is possible the job is not started before the second job being scheduled, making the two job combine into one. Change to wait for the first job being started. Fixes https://github.com/facebook/rocksdb/issues/6017 Pull Request resolved: https://github.com/facebook/rocksdb/pull/6018 Test Plan: ``` while ./db_flush_test --gtest_filter=*FireOnFlushCompletedAfterCommittedResult*; do :; done ``` and let it run for a while. Signed-off-by: Yi Wu Differential Revision: D18405576 Pulled By: riversand963 fbshipit-source-id: 6ebb6262e033d5dc2ef81cb3eb410b314f2de4c9 --- db/db_flush_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/db_flush_test.cc b/db/db_flush_test.cc index c586cd322..08a1d8d1b 100644 --- a/db/db_flush_test.cc +++ b/db/db_flush_test.cc @@ -370,7 +370,7 @@ TEST_F(DBFlushTest, FireOnFlushCompletedAfterCommittedResult) { std::shared_ptr listener = std::make_shared(); SyncPoint::GetInstance()->LoadDependency( - {{"DBImpl::FlushMemTable:AfterScheduleFlush", + {{"DBImpl::BackgroundCallFlush:start", "DBFlushTest::FireOnFlushCompletedAfterCommittedResult:WaitFirst"}, {"DBImpl::FlushMemTableToOutputFile:Finish", "DBFlushTest::FireOnFlushCompletedAfterCommittedResult:WaitSecond"}}); @@ -401,7 +401,7 @@ TEST_F(DBFlushTest, FireOnFlushCompletedAfterCommittedResult) { // flush_opts.wait = true ASSERT_OK(db_->Flush(FlushOptions())); }); - // Wait for first flush scheduled. + // Wait for first flush started. TEST_SYNC_POINT( "DBFlushTest::FireOnFlushCompletedAfterCommittedResult:WaitFirst"); // The second flush will exit early without commit its result. The work