提交 0c404068 编写于 作者: H Haobo Xu

[RocksDB] Move last_sequence and last_flushed_sequence_ update back into lock protected area

Summary: A previous diff moved these outside of lock protected area. Moved back in now. Also moved tmp_batch_ update outside of lock protected area, as only the single write thread can access it.

Test Plan: make check

Reviewers: dhruba

Reviewed By: dhruba

CC: leveldb

Differential Revision: https://reviews.facebook.net/D13137
上级 08740b15
......@@ -2496,10 +2496,12 @@ Status DBImpl::Write(const WriteOptions& options, WriteBatch* my_batch) {
throw std::runtime_error("In memory WriteBatch corruption!");
}
SetTickerCount(options_.statistics, SEQUENCE_NUMBER, last_sequence);
}
mutex_.Lock();
if (status.ok()) {
versions_->SetLastSequence(last_sequence);
last_flushed_sequence_ = current_sequence;
}
mutex_.Lock();
}
if (updates == &tmp_batch_) tmp_batch_.Clear();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册