diff --git a/db/db_impl.cc b/db/db_impl.cc index 51ed9a3a0..f625c775e 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -4137,7 +4137,9 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, if (write_thread_.CompleteParallelWorker(&w)) { // we're responsible for early exit - auto last_sequence = w.parallel_group->last_writer->sequence; + auto last_sequence = + w.parallel_group->last_writer->sequence + + WriteBatchInternal::Count(w.parallel_group->last_writer->batch) - 1; SetTickerCount(stats_, SEQUENCE_NUMBER, last_sequence); versions_->SetLastSequence(last_sequence); write_thread_.EarlyExitParallelGroup(&w); @@ -4437,7 +4439,9 @@ Status DBImpl::WriteImpl(const WriteOptions& write_options, this, true /*dont_filter_deletes*/, true /*concurrent_memtable_writes*/); - assert(last_writer->sequence == last_sequence); + assert(last_writer->sequence + + WriteBatchInternal::Count(last_writer->batch) - 1 == + last_sequence); // CompleteParallelWorker returns true if this thread should // handle exit, false means somebody else did exit_completed_early = !write_thread_.CompleteParallelWorker(&w); diff --git a/db/db_test_util.cc b/db/db_test_util.cc index e6ee304a5..f2906c7ca 100644 --- a/db/db_test_util.cc +++ b/db/db_test_util.cc @@ -85,7 +85,8 @@ bool DBTestBase::ShouldSkipOptions(int option_config, int skip_mask) { option_config == kHashCuckoo || option_config == kUniversalCompaction || option_config == kUniversalCompactionMultiLevel || option_config == kUniversalSubcompactions || - option_config == kFIFOCompaction) { + option_config == kFIFOCompaction || + option_config == kConcurrentSkipList) { return true; } #endif @@ -361,6 +362,11 @@ Options DBTestBase::CurrentOptions( options.max_subcompactions = 4; break; } + case kConcurrentSkipList: { + options.allow_concurrent_memtable_write = true; + options.enable_write_thread_adaptive_yield = true; + break; + } default: break; diff --git a/db/db_test_util.h b/db/db_test_util.h index 031057bbb..b993af8cb 100644 --- a/db/db_test_util.h +++ b/db/db_test_util.h @@ -525,9 +525,10 @@ class DBTestBase : public testing::Test { kOptimizeFiltersForHits = 27, kRowCache = 28, kRecycleLogFiles = 29, - kLevelSubcompactions = 30, - kUniversalSubcompactions = 31, - kEnd = 30 + kConcurrentSkipList = 30, + kEnd = 31, + kLevelSubcompactions = 31, + kUniversalSubcompactions = 32, }; int option_config_;