diff --git a/db/db_impl/db_impl_write.cc b/db/db_impl/db_impl_write.cc index 6aaff802d..39657d462 100644 --- a/db/db_impl/db_impl_write.cc +++ b/db/db_impl/db_impl_write.cc @@ -1882,9 +1882,11 @@ void DBImpl::NotifyOnMemTableSealed(ColumnFamilyData* /*cfd*/, return; } + mutex_.Unlock(); for (auto listener : immutable_db_options_.listeners) { listener->OnMemTableSealed(mem_table_info); } + mutex_.Lock(); } #endif // ROCKSDB_LITE @@ -2085,11 +2087,9 @@ Status DBImpl::SwitchMemtable(ColumnFamilyData* cfd, WriteContext* context) { mutable_cf_options); #ifndef ROCKSDB_LITE - mutex_.Unlock(); // Notify client that memtable is sealed, now that we have successfully // installed a new memtable NotifyOnMemTableSealed(cfd, memtable_info); - mutex_.Lock(); #endif // ROCKSDB_LITE // It is possible that we got here without checking the value of i_os, but // that is okay. If we did, it most likely means that s was already an error.