Revert "Fix for the weird behaviour encountered by ldb Get where it could read only the second-latest value"

This reverts commit 4c696ed001.
This commit is contained in:
amayank 2013-02-18 22:32:07 -08:00
parent fd367e677e
commit f3901e0647
3 changed files with 5 additions and 5 deletions

View File

@ -160,7 +160,7 @@ DBImpl::DBImpl(const Options& options, const std::string& dbname)
stall_level0_num_files_(0),
stall_leveln_slowdown_(0),
started_at_(options.env->NowMicros()),
flush_on_destroy_(true),
flush_on_destroy_(false),
delayed_writes_(0) {
mem_->Ref();

View File

@ -65,9 +65,7 @@ Iterator* DBImplReadOnly::NewIterator(const ReadOptions& options) {
NewMergingIterator(&internal_comparator_, &list[0], list.size());
return NewDBIterator(
&dbname_, env_, user_comparator(), internal_iter,
(options.snapshot != NULL
? reinterpret_cast<const SnapshotImpl*>(options.snapshot)->number_
: versions_->LastSequence()));
reinterpret_cast<const SnapshotImpl*>(options.snapshot)->number_);
}

View File

@ -190,7 +190,9 @@ protected:
// Open the DB.
leveldb::Status st;
if (is_read_only_) {
st = leveldb::DB::OpenForReadOnly(opt, db_path_, &db_);
//st = leveldb::DB::OpenForReadOnly(opt, db_path_, &db_);
// Could not get this to work
st = leveldb::DB::Open(opt, db_path_, &db_);
} else {
st = leveldb::DB::Open(opt, db_path_, &db_);
}