Set log_empty to false even when options.sync is off [fix tests]

main
Igor Canadi 11 years ago
parent e6acb874cd
commit dbe0f327ca
  1. 2
      db/db_impl.cc
  2. 1
      db/db_test.cc

@ -3783,10 +3783,10 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {
PERF_TIMER_START(write_wal_time); PERF_TIMER_START(write_wal_time);
Slice log_entry = WriteBatchInternal::Contents(updates); Slice log_entry = WriteBatchInternal::Contents(updates);
status = log_->AddRecord(log_entry); status = log_->AddRecord(log_entry);
log_empty_ = false;
RecordTick(options_.statistics.get(), WAL_FILE_SYNCED, 1); RecordTick(options_.statistics.get(), WAL_FILE_SYNCED, 1);
RecordTick(options_.statistics.get(), WAL_FILE_BYTES, log_entry.size()); RecordTick(options_.statistics.get(), WAL_FILE_BYTES, log_entry.size());
if (status.ok() && options.sync) { if (status.ok() && options.sync) {
log_empty_ = false;
if (options_.use_fsync) { if (options_.use_fsync) {
StopWatch(env_, options_.statistics.get(), WAL_FILE_SYNC_MICROS); StopWatch(env_, options_.statistics.get(), WAL_FILE_SYNC_MICROS);
status = log_->file()->Fsync(); status = log_->file()->Fsync();

@ -987,7 +987,6 @@ void VerifyTableProperties(DB* db, uint64_t expected_entries_size) {
TablePropertiesCollection props; TablePropertiesCollection props;
ASSERT_OK(db->GetPropertiesOfAllTables(&props)); ASSERT_OK(db->GetPropertiesOfAllTables(&props));
assert(props.size() == 4);
ASSERT_EQ(4U, props.size()); ASSERT_EQ(4U, props.size());
std::unordered_set<uint64_t> unique_entries; std::unordered_set<uint64_t> unique_entries;

Loading…
Cancel
Save