From 3f72b7ce19a46383727bc76d3216467410e08aff Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 13 Apr 2018 22:08:57 -0700 Subject: [PATCH] ircd::db: Update gopts; add seqnum option; fix missing readahead. --- include/ircd/db/opts.h | 6 ++++-- ircd/db.cc | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/ircd/db/opts.h b/include/ircd/db/opts.h index 743319bce..2671ee5f0 100644 --- a/include/ircd/db/opts.h +++ b/include/ircd/db/opts.h @@ -73,8 +73,10 @@ struct ircd::db::gopts :opts { database::snapshot snapshot; - size_t readahead { 4_KiB }; - const rocksdb::Slice *upper_bound {nullptr}; + const rocksdb::Slice *lower_bound { nullptr }; + const rocksdb::Slice *upper_bound { nullptr }; + size_t readahead { 0 }; + uint64_t seqnum { 0 }; using opts::opts; }; diff --git a/ircd/db.cc b/ircd/db.cc index abe1fbbd8..07a4a8fce 100644 --- a/ircd/db.cc +++ b/ircd/db.cc @@ -4927,11 +4927,11 @@ ircd::db::make_opts(const gopts &opts) rocksdb::ReadOptions ret; assert(ret.fill_cache); ret.read_tier = NON_BLOCKING; - ret.iterate_upper_bound = opts.upper_bound; // slice* for exclusive upper bound. when prefixes are used this value must // have the same prefix because ordering is not guaranteed between prefixes - //ret.iterate_upper_bound = nullptr; + ret.iterate_lower_bound = opts.lower_bound; + ret.iterate_upper_bound = opts.upper_bound; ret += opts; return ret; @@ -4941,6 +4941,9 @@ rocksdb::ReadOptions & ircd::db::operator+=(rocksdb::ReadOptions &ret, const gopts &opts) { + ret.iter_start_seqnum = opts.seqnum; + ret.readahead_size = opts.readahead; + if(opts.snapshot && !test(opts, get::NO_SNAPSHOT)) ret.snapshot = opts.snapshot;