0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-26 15:33:54 +01:00

ircd::db: Update gopts; add seqnum option; fix missing readahead.

This commit is contained in:
Jason Volk 2018-04-13 22:08:57 -07:00
parent 7c92eb2757
commit 3f72b7ce19
2 changed files with 9 additions and 4 deletions

View file

@ -73,8 +73,10 @@ struct ircd::db::gopts
:opts<get>
{
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<get>::opts;
};

View file

@ -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;