// and protects against concurrent loggers and concurrent writes
// into memtables
+ TEST_SYNC_POINT("DBImpl::WriteImpl:BeforeLeaderEnters");
last_batch_group_size_ =
write_thread_.EnterAsBatchGroupLeader(&w, &write_group);
do {
Options options = CurrentOptions();
options.env = env_;
- env_->log_write_slowdown_.store(100);
options.statistics = rocksdb::CreateDBStatistics();
Reopen(options);
+ rocksdb::SyncPoint::GetInstance()->LoadDependency(
+ {{"WriteThread::JoinBatchGroup:BeganWaiting",
+ "DBImpl::WriteImpl:BeforeLeaderEnters"}});
+ rocksdb::SyncPoint::GetInstance()->EnableProcessing();
+
// Start threads
GCThread thread[kGCNumThreads];
for (int id = 0; id < kGCNumThreads; id++) {
thread[id].done = false;
env_->StartThread(GCThreadBody, &thread[id]);
}
-
- for (int id = 0; id < kGCNumThreads; id++) {
- while (thread[id].done == false) {
- env_->SleepForMicroseconds(100000);
- }
- }
- env_->log_write_slowdown_.store(0);
+ env_->WaitForJoin();
ASSERT_GT(TestGetTickerCount(options, WRITE_DONE_BY_OTHER), 0);
* 3.2) an existing memtable writer group leader tell us to finish memtable
* writes in parallel.
*/
+ TEST_SYNC_POINT_CALLBACK("WriteThread::JoinBatchGroup:BeganWaiting", w);
AwaitState(w, STATE_GROUP_LEADER | STATE_MEMTABLE_WRITER_LEADER |
STATE_PARALLEL_MEMTABLE_WRITER | STATE_COMPLETED,
&jbg_ctx);