incremental_reader_selector: account for possibly disengaged lower bound

In addition to the constructor (fixed previously) the check for no
sstables on the first call to select() also has to be prepared for the
lower bound of the range being disengaged.

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <4ab1296c71814fcd492996fa36fd00fd7bbbbc7f.1502949875.git.bdenes@scylladb.com>
This commit is contained in:
Botond Dénes
2017-08-17 09:05:22 +03:00
committed by Avi Kivity
parent af83b7f57b
commit e70cfc8f36

View File

@@ -419,7 +419,8 @@ public:
// For the lower bound of the token range the _selector
// might not return any sstables, in this case try again
// with next_token unless it's maximum token.
if (position == _pr->start()->value().token() && !selection.next_token.is_maximum()) {
if (!selection.next_token.is_maximum()
&& position == (_pr->start() ? _pr->start()->value().token() : dht::minimum_token())) {
dblog.trace("incremental_reader_selector {}: no sstables intersect with the lower bound, retrying", this);
_selector_position = std::move(selection.next_token);
return create_new_readers(nullptr);