Revert "Fix for the weird behaviour encountered by ldb Get where it could read only the second-latest value"
This reverts commit 4c696ed0018800b62e2448a4ead438255140fc25.
This commit is contained in:
parent
fd367e677e
commit
f3901e0647
@ -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();
|
||||
|
||||
|
@ -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_);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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_);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user