diff --git a/db/db_impl.cc b/db/db_impl.cc index c50eb159f..4b2e97689 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3783,10 +3783,10 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) { PERF_TIMER_START(write_wal_time); Slice log_entry = WriteBatchInternal::Contents(updates); status = log_->AddRecord(log_entry); + log_empty_ = false; RecordTick(options_.statistics.get(), WAL_FILE_SYNCED, 1); RecordTick(options_.statistics.get(), WAL_FILE_BYTES, log_entry.size()); if (status.ok() && options.sync) { - log_empty_ = false; if (options_.use_fsync) { StopWatch(env_, options_.statistics.get(), WAL_FILE_SYNC_MICROS); status = log_->file()->Fsync(); diff --git a/db/db_test.cc b/db/db_test.cc index 665993ea7..d3c5e2d55 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -987,7 +987,6 @@ void VerifyTableProperties(DB* db, uint64_t expected_entries_size) { TablePropertiesCollection props; ASSERT_OK(db->GetPropertiesOfAllTables(&props)); - assert(props.size() == 4); ASSERT_EQ(4U, props.size()); std::unordered_set unique_entries;