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:
parent
7c92eb2757
commit
3f72b7ce19
2 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue