0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-10-01 05:08:59 +02:00

ircd::db: Fix empty row seek; fix potential coherence issue on offload.

This commit is contained in:
Jason Volk 2017-10-17 00:47:30 -07:00
parent 517f1f1548
commit 3c0d5bd5d6

View file

@ -2331,7 +2331,9 @@ size_t
ircd::db::seek(row &r,
const pos &p)
{
assert(!r.empty());
if(r.empty())
return 0;
const column &c(r[0]);
const database &d(c);
const ircd::timer timer;
@ -3411,16 +3413,18 @@ ircd::db::_seek(database::column &c,
return valid(*it);
}
const auto it_key
{
valid_it? slice(it->key()) : string_view{}
};
const auto blocking_it
{
_seek_offload(c, opts, [&valid_it, &it, &p]
_seek_offload(c, opts, [&valid_it, &it_key, &p]
(rocksdb::Iterator &blocking_it)
{
if(valid_it)
{
assert(valid(*it));
_seek_(blocking_it, slice(it->key()));
}
_seek_(blocking_it, it_key);
_seek_(blocking_it, p);
})