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

This reverts commit 4c696ed001.
main
amayank 12 years ago
parent fd367e677e
commit f3901e0647
  1. 2
      db/db_impl.cc
  2. 4
      db/db_impl_readonly.cc
  3. 4
      util/ldb_cmd.h

@ -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…
Cancel
Save