sstables: index_reader: Fix abort in advance_and_check_if_present()

Happens when the key is missing and after all keys in the sstables.

Fixes #2345.
This commit is contained in:
Tomasz Grabiec
2017-05-04 14:31:00 +02:00
parent ddc1d80c28
commit ec45f1e51d

View File

@@ -500,6 +500,9 @@ public:
// Like advance_to(dht::ring_position_view), but returns information whether the key was found
future<bool> advance_and_check_if_present(dht::ring_position_view key) {
return advance_to(key).then([this, key] {
if (eof()) {
return make_ready_future<bool>(false);
}
return ensure_partition_data().then([this, key] {
dht::ring_position_comparator cmp(*_sstable->_schema);
return cmp(key, partition_key()) == 0;