Skip to content

Commit dbe0f32

Browse files
committed
Set log_empty to false even when options.sync is off [fix tests]
1 parent e6acb87 commit dbe0f32

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

db/db_impl.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3783,10 +3783,10 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {
37833783
PERF_TIMER_START(write_wal_time);
37843784
Slice log_entry = WriteBatchInternal::Contents(updates);
37853785
status = log_->AddRecord(log_entry);
3786+
log_empty_ = false;
37863787
RecordTick(options_.statistics.get(), WAL_FILE_SYNCED, 1);
37873788
RecordTick(options_.statistics.get(), WAL_FILE_BYTES, log_entry.size());
37883789
if (status.ok() && options.sync) {
3789-
log_empty_ = false;
37903790
if (options_.use_fsync) {
37913791
StopWatch(env_, options_.statistics.get(), WAL_FILE_SYNC_MICROS);
37923792
status = log_->file()->Fsync();

db/db_test.cc

-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,6 @@ void VerifyTableProperties(DB* db, uint64_t expected_entries_size) {
987987
TablePropertiesCollection props;
988988
ASSERT_OK(db->GetPropertiesOfAllTables(&props));
989989

990-
assert(props.size() == 4);
991990
ASSERT_EQ(4U, props.size());
992991
std::unordered_set<uint64_t> unique_entries;
993992

0 commit comments

Comments
 (0)